Fix digging the machine and don't allow anything to be put in the output slot

master
Samuel Sieb 2016-03-08 12:50:51 -08:00
parent c6cd908192
commit d70a8c9723
1 changed files with 9 additions and 12 deletions

View File

@ -71,18 +71,7 @@ minetest.register_node("mydeck:machine", {
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
if inv:is_empty("ingot") and
inv:is_empty("res") and
inv:is_empty("wool") and
inv:is_empty("steel") and
inv:is_empty("stick") and
inv:is_empty("brush") and
inv:is_empty("dye") and
inv:is_empty("cbrush") then
return true
else
return false
end
return inv:is_empty("ingot") and inv:is_empty("res")
end,
on_construct = function(pos)
@ -128,6 +117,14 @@ on_construct = function(pos)
inv:set_size("res", 1)
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if listname == "res" then
return 0
else
return stack:get_count()
end
end,
on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()