Added Dig_By_Water group --> the water dig and remove the node but drop (if the item drop)
This commit is contained in:
parent
f836f85170
commit
fe773cd91a
2 changed files with 29 additions and 10 deletions
|
@ -96,6 +96,25 @@ grow_reeds = function(pos, node)
|
|||
end
|
||||
|
||||
-- ABMs
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:dig_by_water"},
|
||||
neighbors = {"group:water"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos)
|
||||
local originalpos = pos
|
||||
for dx=-1,1 do
|
||||
for dy=-1,1 do
|
||||
pos.x = pos.x+dx
|
||||
pos.y = pos.y+dy
|
||||
if minetest.env:get_node(pos).name == "group:water" then
|
||||
minetest.env:set_node(pos, {name="default:air"})
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:cactus"},
|
||||
neighbors = {"group:sand"},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue