Add _on_dispense callback for dispenser; refactor
This commit is contained in:
parent
8774e7674d
commit
fa10dc93ae
11 changed files with 196 additions and 211 deletions
|
@ -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,
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue