From 05e6afb93a109fec86b31a50033adbca5cc19fc8 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 19 Sep 2022 14:19:49 +0200 Subject: [PATCH] Fix bonemealing of large fungi --- mods/ITEMS/mcl_crimson/init.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_crimson/init.lua b/mods/ITEMS/mcl_crimson/init.lua index b0ba09d336..6f2e48a05f 100644 --- a/mods/ITEMS/mcl_crimson/init.lua +++ b/mods/ITEMS/mcl_crimson/init.lua @@ -55,8 +55,11 @@ local function spread_nether_plants(pos,node) table.shuffle(nn) nn[1] = pos for i=1,math.random(1,math.min(#nn,12)) do - minetest.set_node(vector.offset(nn[i],0,1,0),{name=nether_plants[n][math.random(#nether_plants[n])]}) - mcl_dye.add_bone_meal_particle(vector.offset(nn[i],0,1,0)) + local p = vector.offset(nn[i],0,1,0) + if minetest.get_node(p).name == "air" then + minetest.set_node(p,{name=nether_plants[n][math.random(#nether_plants[n])]}) + mcl_dye.add_bone_meal_particle(vector.offset(nn[i],0,1,0)) + end end end @@ -82,6 +85,7 @@ minetest.register_node("mcl_crimson:warped_fungus", { if nodepos.name == "mcl_crimson:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then local random = math.random(1, 5) if random == 1 then + minetest.remove_node(pos) generate_warped_tree(pos) end end @@ -382,6 +386,7 @@ minetest.register_node("mcl_crimson:crimson_fungus", { if nodepos.name == "mcl_crimson:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then local random = math.random(1, 5) if random == 1 then + minetest.remove_node(pos) generate_crimson_tree(pos) end end