Default: Make snowblock change 'dirt with grass' below
authorparamat <mat.gregory@virginmedia.com>
Tue, 8 Nov 2016 17:30:58 +0000 (17:30 +0000)
committerparamat <mat.gregory@virginmedia.com>
Thu, 10 Nov 2016 08:10:34 +0000 (08:10 +0000)
To be consistent with the snow slab.

mods/default/nodes.lua

index bb3dfc8cd7da49053cbece83f1f5ebf56398e305..77dc6c4813e31a794256b323bfba5b2fdb82b29f 100644 (file)
@@ -473,6 +473,13 @@ minetest.register_node("default:snowblock", {
                dug = {name = "default_snow_footstep", gain = 0.2},
                dig = {name = "default_snow_footstep", gain = 0.2}
        }),
+
+       on_construct = function(pos)
+               pos.y = pos.y - 1
+               if minetest.get_node(pos).name == "default:dirt_with_grass" then
+                       minetest.set_node(pos, {name = "default:dirt_with_snow"})
+               end
+       end,
 })
 
 minetest.register_node("default:ice", {