mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-20 14:23:16 -04:00
turn dirt_with_snow into dirt_with_grass when snow digged
This commit is contained in:
parent
c1cd24c378
commit
35de89c091
1 changed files with 14 additions and 0 deletions
|
@ -118,6 +118,20 @@ function on_punchnode(p, node)
|
|||
end
|
||||
minetest.register_on_punchnode(on_punchnode)
|
||||
|
||||
--
|
||||
-- Snow Behavior
|
||||
--
|
||||
|
||||
--turn dirt_with_snow into dirt_with_grass when snow digged
|
||||
minetest.register_on_dignode(function(pos, oldnode, digger)
|
||||
if oldnode.name == "default:snow" then
|
||||
pos.y = pos.y-1
|
||||
if minetest.env:get_node(pos).name == "default:dirt_with_snow" then
|
||||
minetest.env:set_node(pos, {name="default:dirt_with_grass"})
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
--
|
||||
-- Lavacooling
|
||||
--
|
||||
|
|
Loading…
Add table
Reference in a new issue