From 31058c914eae6334ed4ba9000064538bd2b87e0b Mon Sep 17 00:00:00 2001 From: kilbith Date: Wed, 13 Jan 2016 18:17:38 +0100 Subject: [PATCH] Drop some node aliases --- cooking.lua | 2 -- nodes.lua | 2 -- worktable.lua | 13 +++++++------ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/cooking.lua b/cooking.lua index c35bcd0..201ea82 100644 --- a/cooking.lua +++ b/cooking.lua @@ -1,5 +1,3 @@ -minetest.register_alias("xdecor:cauldron", "xdecor:cauldron_empty") -- legacy code - local cauldron_cbox = { type = "fixed", fixed = { diff --git a/nodes.lua b/nodes.lua index 3a44feb..4553f76 100644 --- a/nodes.lua +++ b/nodes.lua @@ -344,8 +344,6 @@ xdecor.register("painting_1", { end }) -minetest.register_alias("xdecor:painting", "xdecor:painting_1") -- legacy code - for i = 2, 4 do xdecor.register("painting_"..i, { tiles = {"xdecor_painting_"..i..".png"}, diff --git a/worktable.lua b/worktable.lua index 10d5aaf..8b3643c 100644 --- a/worktable.lua +++ b/worktable.lua @@ -38,8 +38,8 @@ function worktable.get_recipe(item) elseif minetest.registered_items["default:"..item:sub(7)] then item = item:gsub("group:", "default:") else - for node, definition in pairs(minetest.registered_items) do - if definition.groups[item:match("[^,:]+$")] then + for node, def in pairs(minetest.registered_items) do + if def.groups[item:match("[^,:]+$")] then item = node end end @@ -128,7 +128,8 @@ local function tab_category(tab_id) minetest.registered_items, minetest.registered_nodes, minetest.registered_tools, - minetest.registered_craftitems } + minetest.registered_craftitems + } return id_category[tab_id] or id_category[1] end @@ -294,10 +295,10 @@ function worktable.put(pos, listname, _, stack) return 0 end -function worktable.take(pos, listname, _, stack, player) +function worktable.take(_, listname, _, stack, player) if listname == "forms" then - local user_inv = player:get_inventory() - if user_inv:room_for_item("main", stack:get_name()) then + local inv = player:get_inventory() + if inv:room_for_item("main", stack:get_name()) then return -1 end return 0