From babe4380acf1fcd89c3658e72ded9942fbec21bf Mon Sep 17 00:00:00 2001 From: HybridDog Date: Sun, 16 Aug 2015 16:40:49 +0200 Subject: disallow repairing tools using the 'to craft grid', allow it to put items of specific groups and (maybe) make it keep the meta of items, remove unused elseif, change a bit translation and use table.concat at one place because I read somewhere that it's faster than .. --- api.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'api.lua') diff --git a/api.lua b/api.lua index 5c87af4..59296db 100644 --- a/api.lua +++ b/api.lua @@ -117,7 +117,7 @@ end -- register_craft function unified_inventory.register_craft(options) - if options.output == nil then + if not options.output then return end local itemstack = ItemStack(options.output) @@ -127,7 +127,7 @@ function unified_inventory.register_craft(options) if options.type == "normal" and options.width == 0 then options = { type = "shapeless", items = options.items, output = options.output, width = 0 } end - if unified_inventory.crafts_for.recipe[itemstack:get_name()] == nil then + if not unified_inventory.crafts_for.recipe[itemstack:get_name()] then unified_inventory.crafts_for.recipe[itemstack:get_name()] = {} end table.insert(unified_inventory.crafts_for.recipe[itemstack:get_name()],options) @@ -220,9 +220,7 @@ end function unified_inventory.is_creative(playername) - if minetest.check_player_privs(playername, {creative=true}) or - minetest.setting_getbool("creative_mode") then - return true - end + return minetest.check_player_privs(playername, {creative=true}) + or minetest.setting_getbool("creative_mode") end -- cgit v1.2.3