Grass block: Change grass color depending on biome

This commit is contained in:
Wuzzy 2019-03-25 09:22:08 +01:00
parent 2d34a2982a
commit 1b7c41fc81
2 changed files with 23 additions and 12 deletions

View file

@ -321,18 +321,9 @@ minetest.register_node("mcl_core:dirt_with_grass", {
footstep = {name="default_grass_footstep", gain=0.4},
}),
on_construct = function(pos)
local dim = mcl_worlds.pos_to_dimension(pos)
local dry
if dim == "nether" then
dry = true
else
local found_node = minetest.find_node_near(pos, 1, {"mcl_core:dirt_with_dry_grass", "mcl_core:dirt_with_dry_grass_snow"})
if found_node then
dry = true
end
end
if dry then
minetest.set_node(pos, {name="mcl_core:dirt_with_dry_grass"})
local new_node = mcl_core.get_grass_block_type(pos)
if new_node.name ~= "mcl_core:dirt_with_grass" then
minetest.set_node(pos, new_node)
end
return mcl_core.on_snowable_construct(pos)
end,