Dirt path covers grass below

This commit is contained in:
Wuzzy 2019-09-05 18:49:38 +02:00
parent 7fee79f884
commit 3d9496ec56
2 changed files with 4 additions and 4 deletions

View File

@ -243,7 +243,7 @@ minetest.register_abm( -- dirt and grass footsteps becomes dirt with grass if un
action = function(pos, node)
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local name = minetest.get_node(above).name
local partialblock = minetest.get_item_group(name, "slab") ~= 0 or minetest.get_item_group(name, "stair") ~= 0
local partialblock = minetest.get_item_group(name, "path") ~= 0 or minetest.get_item_group(name, "slab") ~= 0 or minetest.get_item_group(name, "stair") ~= 0
local nodedef = minetest.registered_nodes[name]
if nodedef and (not partialblock) and (nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none" and (minetest.get_node_light(above) or 0) >= 8 then
minetest.set_node(pos, {name = "default:dirt_with_grass"})
@ -260,7 +260,7 @@ minetest.register_abm( -- dirt with grass becomes dirt if covered
action = function(pos, node)
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local name = minetest.get_node(above).name
local partialblock = minetest.get_item_group(name, "slab") ~= 0 or minetest.get_item_group(name, "stair") ~= 0
local partialblock = minetest.get_item_group(name, "path") ~= 0 or minetest.get_item_group(name, "slab") ~= 0 or minetest.get_item_group(name, "stair") ~= 0
local nodedef = minetest.registered_nodes[name]
if name ~= "ignore" and nodedef and (partialblock) or (not ((nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none")) then
minetest.set_node(pos, {name = "default:dirt"})

View File

@ -309,7 +309,7 @@ minetest.register_node(
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5-2/16, 0.5}
},
tiles = {"default_dirt.png"},
groups = {crumbly = 3, fall_damage_add_percent = -10},
groups = {crumbly = 3, path = 1, fall_damage_add_percent = -10},
is_ground_content = false,
sounds = default.node_sound_dirt_defaults(),
})
@ -342,7 +342,7 @@ minetest.register_node(
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5-2/16, 0.5}
},
tiles = {"default_dirt.png"},
groups = {crumbly = 3, fall_damage_add_percent = -10},
groups = {crumbly = 3, path = 1, fall_damage_add_percent = -10},
is_ground_content = false,
sounds = default.node_sound_dirt_defaults(),
})