Fix chorus fruit not working with damage on

This commit is contained in:
Wuzzy 2018-01-23 04:24:05 +01:00
parent 232dbca783
commit 101285d04d

@ -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 return minetest.registered_nodes[node_under.name].on_rightclick(pointed_thing.under, node_under, placer, itemstack) or itemstack
end end
end end
random_teleport(player) local count = itemstack:get_count()
return minetest.do_item_eat(0, nil, itemstack, player, pointed_thing) 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 end
minetest.register_craftitem("mcl_end:chorus_fruit", { minetest.register_craftitem("mcl_end:chorus_fruit", {