From ab2fb7e404fc03502e3dc9e16560d3259a8f3c33 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 5 Sep 2017 04:03:23 +0200 Subject: [PATCH] Don't kill mushrooms on podzol and mycelium --- mods/ITEMS/mcl_mushrooms/small.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_mushrooms/small.lua b/mods/ITEMS/mcl_mushrooms/small.lua index 54b14d6cb2..b12e925bf0 100644 --- a/mods/ITEMS/mcl_mushrooms/small.lua +++ b/mods/ITEMS/mcl_mushrooms/small.lua @@ -90,12 +90,15 @@ Code based on information gathered from Minecraft Wiki ]] minetest.register_abm({ - label = "Mushroom spread", + label = "Mushroom spread and death", nodenames = {"mcl_mushrooms:mushroom_brown", "mcl_mushrooms:mushroom_red"}, interval = 11, chance = 50, action = function(pos, node) - if minetest.get_node_light(pos, nil) > 12 then + local node_soil = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name + -- Mushrooms uproot in light except on podzol or mycelium + if node_soil ~= "mcl_core:podzol" and node_soil ~= "mcl_core:mycelium" and + node_soil ~= "mcl_core:podzol_snow" and node_soil ~= "mcl_core:mycelium_snow" and minetest.get_node_light(pos, nil) > 12 then minetest.dig_node(pos) return end