Add _on_dispense callback for dispenser; refactor

This commit is contained in:
Wuzzy 2018-02-01 22:45:19 +01:00
parent 8774e7674d
commit fa10dc93ae
11 changed files with 196 additions and 211 deletions

View file

@ -76,6 +76,13 @@ minetest.register_node("mcl_tnt:tnt", {
tnt.ignite(pointed_thing.under)
return true
end,
_on_dispense = function(stack, pos, droppos, dropnode, dropdir)
-- Place and ignite TNT
if minetest.registered_nodes[dropnode.name].buildable_to then
minetest.set_node(droppos, {name = stack:get_name()})
tnt.ignite(droppos)
end
end,
sounds = sounds,
})