summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
authorHybridDog <adresse_test@t-online.de>2015-08-16 16:40:49 +0200
committerHybridDog <adresse_test@t-online.de>2015-08-16 16:40:49 +0200
commitbabe4380acf1fcd89c3658e72ded9942fbec21bf (patch)
tree520cc5dca9ad76d016f5519c1034257024408a4e /api.lua
parent570d2cb162bd6d38fddd56f2eade7cc59dfd0f9d (diff)
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 ..
Diffstat (limited to 'api.lua')
-rw-r--r--api.lua10
1 files changed, 4 insertions, 6 deletions
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