From 101285d04de261b5bd363f97b180ed661d0d2fd6 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 23 Jan 2018 04:24:05 +0100 Subject: [PATCH] Fix chorus fruit not working with damage on --- mods/ITEMS/mcl_end/chorus_plant.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_end/chorus_plant.lua b/mods/ITEMS/mcl_end/chorus_plant.lua index 3b27dd5a..882971f1 100644 --- a/mods/ITEMS/mcl_end/chorus_plant.lua +++ b/mods/ITEMS/mcl_end/chorus_plant.lua @@ -336,8 +336,13 @@ local eat_chorus_fruit = function(itemstack, player, pointed_thing) return minetest.registered_nodes[node_under.name].on_rightclick(pointed_thing.under, node_under, placer, itemstack) or itemstack end end - random_teleport(player) - return minetest.do_item_eat(0, nil, itemstack, player, pointed_thing) + local count = itemstack:get_count() + local new_itemstack = minetest.do_item_eat(0, nil, itemstack, player, pointed_thing) + local new_count = new_itemstack:get_count() + if count ~= new_count or new_itemstack:get_name() ~= "mcl_end:chorus_fruit" then + random_teleport(player) + end + return new_itemstack end minetest.register_craftitem("mcl_end:chorus_fruit", {