From b9342c4ba416bf00510507c269f4a73b3afc2423 Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Fri, 3 May 2019 17:44:33 +0200 Subject: [PATCH] Updates via shellscript --- init.lua | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/init.lua b/init.lua index 6de9e99..6ea719d 100644 --- a/init.lua +++ b/init.lua @@ -75,6 +75,9 @@ mt_ext = { img = nil end return img or mt_ext.texture_modifier_inventorycube(chosen_tiles[1], chosen_tiles[2], chosen_tiles[3]) + end, + get_color_int=function(color) + return color.b + (color.g*256) + (color.r*256*256) end } @@ -269,18 +272,6 @@ table_ext= { return dst end, - get_value = function(table, key) - if type(key) == "table" then - for k, v in pairs(table) do - if key==k then - return v - end - end - return nil - end - return table[key] - end, - keys = function(t) local keys = {} for key, _ in pairs(t) do @@ -571,7 +562,7 @@ conf={ return "Not inside range : Expected value >= "..constraints.range[1].." and <= "..constraints.range[1]..", found "..minetest.write_json(value) end end - if constraints.possible_values and not table_ext.get_value(constraints.possible_values,value) then + if constraints.possible_values and not constraints.possible_values[value] then return "None of the possible values : Expected one of "..minetest.write_json(table_ext.keys(constraints.possible_values))..", found "..minetest.write_json(value) end if t == "table" then