From 40453d597bff170d4e363a90523c134da203f594 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 14 Dec 2019 00:02:36 +0100 Subject: [PATCH] Add LBM to kill old drygrass nodes --- mods/ITEMS/mcl_core/functions.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 3c208acb7..551201a2e 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -757,6 +757,24 @@ minetest.register_abm({ end, }) +minetest.register_lbm({ + label = "Replace legacy dry grass", + name = "mcl_core:replace_legacy_dry_grass", + nodenames = {"mcl_core:dirt_with_dry_grass", "mcl_core:dirt_with_dry_grass_snow"}, + action = function(pos, node) + local biome_data = minetest.get_biome_data(pos) + local index = 0 + if biome_data then + local biome = biome_data.biome + local biome_name = minetest.get_biome_name(biome) + local reg_biome = minetest.registered_biomes[biome_name] + if reg_biome then + minetest.set_node(pos, {name = node.name, param2 = reg_biome._mcl_palette_index}) + end + end + end, +}) + -------------------------- -- Try generate tree --- --------------------------