forked from Mirrorlandia_minetest/minetest
Allow custom liquids to have drops
This commit is contained in:
parent
1cea2f1b49
commit
282f53ddb7
@ -79,13 +79,9 @@ core.register_entity(":__builtin:falling_node", {
|
||||
local np = {x=bcp.x, y=bcp.y+1, z=bcp.z}
|
||||
-- Check what's here
|
||||
local n2 = core.get_node(np)
|
||||
-- If it's not air or liquid, remove node and replace it with
|
||||
-- it's drops
|
||||
if n2.name ~= "air" and (not core.registered_nodes[n2.name] or
|
||||
core.registered_nodes[n2.name].liquidtype == "none") then
|
||||
-- remove node and replace it with it's drops
|
||||
local drops = core.get_node_drops(n2.name, "")
|
||||
core.remove_node(np)
|
||||
-- Add dropped items
|
||||
local _, dropped_item
|
||||
for _, dropped_item in ipairs(drops) do
|
||||
core.add_item(np, dropped_item)
|
||||
@ -95,7 +91,6 @@ core.register_entity(":__builtin:falling_node", {
|
||||
for _, callback in ipairs(core.registered_on_dignodes) do
|
||||
callback(np, n2, nil)
|
||||
end
|
||||
end
|
||||
-- Create node and remove entity
|
||||
core.add_node(np, self.node)
|
||||
self.object:remove()
|
||||
|
Loading…
Reference in New Issue
Block a user