From e1d67a20959d1249277afcb05db40eb2f5c28495 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 23 Feb 2022 17:15:40 +0100 Subject: [PATCH] Disconnect stems from carved pumpkins after dig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Carved pumpkins can end up being connected to a stem – either if they were grown in a previous version of MineClone2 or Mineclonia, or if a player carves them before harvesting them. This patch makes sure that stems turn into unconnected stems after such a carved pumpkin is dug. --- mods/ITEMS/mcl_farming/pumpkin.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_farming/pumpkin.lua b/mods/ITEMS/mcl_farming/pumpkin.lua index fcfe3bd1a8..78883626c2 100644 --- a/mods/ITEMS/mcl_farming/pumpkin.lua +++ b/mods/ITEMS/mcl_farming/pumpkin.lua @@ -179,7 +179,6 @@ if minetest.get_modpath("mcl_armor") then pumpkin_hud[player] = nil end) end -minetest.register_node("mcl_farming:pumpkin_face", pumpkin_face_base_def) -- Register stem growth mcl_farming:add_plant("plant_pumpkin_stem", "mcl_farming:pumpkintige_unconnect", {"mcl_farming:pumpkin_1", "mcl_farming:pumpkin_2", "mcl_farming:pumpkin_3", "mcl_farming:pumpkin_4", "mcl_farming:pumpkin_5", "mcl_farming:pumpkin_6", "mcl_farming:pumpkin_7"}, 30, 5) @@ -187,6 +186,10 @@ mcl_farming:add_plant("plant_pumpkin_stem", "mcl_farming:pumpkintige_unconnect", -- Register actual pumpkin, connected stems and stem-to-pumpkin growth mcl_farming:add_gourd("mcl_farming:pumpkintige_unconnect", "mcl_farming:pumpkintige_linked", "mcl_farming:pumpkintige_unconnect", stem_def, stem_drop, "mcl_farming:pumpkin", pumpkin_base_def, 30, 15, "mcl_farming_pumpkin_stem_connected.png^[colorize:#FFA800:127") +-- Steal function to properly disconnect a carved pumpkin +pumpkin_face_base_def.after_dig_node = minetest.registered_nodes["mcl_farming:pumpkin"].after_dig_node +minetest.register_node("mcl_farming:pumpkin_face", pumpkin_face_base_def) + -- Jack o'Lantern minetest.register_node("mcl_farming:pumpkin_face_light", { description = S("Jack o'Lantern"),