From 655a240107fca15fa408a02fcdb3f275580a57d4 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 9 Mar 2019 23:19:14 +0100 Subject: [PATCH] Chorus plant: Prevent double placement of flowers --- mods/ITEMS/mcl_end/chorus_plant.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/mods/ITEMS/mcl_end/chorus_plant.lua b/mods/ITEMS/mcl_end/chorus_plant.lua index 6f7b849b0e..f9f4a59af0 100644 --- a/mods/ITEMS/mcl_end/chorus_plant.lua +++ b/mods/ITEMS/mcl_end/chorus_plant.lua @@ -283,12 +283,18 @@ mcl_end.grow_chorus_plant_step = function(pos, node) for _, f in ipairs(new_flowers) do if age >= MAX_FLOWER_AGE then - minetest.set_node(f, {name="mcl_end:chorus_flower_dead"}) - grown = true + local nn = minetest.get_node(f).name + if nn ~= "mcl_end:chorus_flower" and nn ~= "mcl_end:chorus_flower_dead" then + minetest.set_node(f, {name="mcl_end:chorus_flower_dead"}) + grown = true + end else - minetest.set_node(f, {name="mcl_end:chorus_flower", param2 = age}) - table.insert(new_flower_buds, f) - grown = true + local nn = minetest.get_node(f).name + if nn ~= "mcl_end:chorus_flower" and nn ~= "mcl_end:chorus_flower_dead" then + minetest.set_node(f, {name="mcl_end:chorus_flower", param2 = age}) + table.insert(new_flower_buds, f) + grown = true + end end end if #new_flowers >= 1 then