Minor style cleaning
This commit is contained in:
parent
2655c3e867
commit
da7cec38f2
@ -254,11 +254,9 @@ end
|
|||||||
|
|
||||||
function worktable.put(pos, listname, _, stack)
|
function worktable.put(pos, listname, _, stack)
|
||||||
local stackname = stack:get_name()
|
local stackname = stack:get_name()
|
||||||
if listname == "tool" and stack:get_wear() > 0 and
|
if (listname == "tool" and stack:get_wear() > 0 and
|
||||||
worktable.repairable_tools:find(stackname:match(":(%w+)")) then
|
worktable.repairable_tools:find(stackname:match(":(%w+)"))) or
|
||||||
return stack:get_count()
|
(listname == "input" and worktable.nodes(minetest.registered_nodes[stackname])) or
|
||||||
end
|
|
||||||
if (listname == "input" and worktable.nodes(minetest.registered_nodes[stackname])) or
|
|
||||||
(listname == "hammer" and stackname == "xdecor:hammer") or
|
(listname == "hammer" and stackname == "xdecor:hammer") or
|
||||||
listname == "storage" or listname == "trash" then
|
listname == "storage" or listname == "trash" then
|
||||||
if listname == "trash" then trash_delete(pos) end
|
if listname == "trash" then trash_delete(pos) end
|
||||||
@ -269,8 +267,8 @@ end
|
|||||||
|
|
||||||
function worktable.take(_, listname, _, stack, player)
|
function worktable.take(_, listname, _, stack, player)
|
||||||
if listname == "forms" then
|
if listname == "forms" then
|
||||||
local free_space = player:get_inventory():room_for_item("main", stack:get_name())
|
local inv = player:get_inventory()
|
||||||
if free_space then return -1 end
|
if inv:room_for_item("main", stack:get_name()) then return -1 end
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
@ -408,7 +406,9 @@ for _, d in pairs(worktable.defs) do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else minetest.item_place_node(itemstack, clicker, pointed_thing) end
|
else
|
||||||
|
minetest.item_place_node(itemstack, clicker, pointed_thing)
|
||||||
|
end
|
||||||
|
|
||||||
if combined and not minetest.setting_getbool("creative_mode") then
|
if combined and not minetest.setting_getbool("creative_mode") then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
|
Loading…
Reference in New Issue
Block a user