From af846f03090dad73211d452d062da4faaba33fe5 Mon Sep 17 00:00:00 2001 From: BlockMen Date: Tue, 21 May 2013 01:16:20 +0300 Subject: [PATCH] turn dirt_with_snow into dirt_with_grass when snow digged --- mods/default/functions.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mods/default/functions.lua b/mods/default/functions.lua index c5245f76..12f510d1 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -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 --