From d699459bac09e4fcb2a8ddbbe8c283f22aedb388 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 9 Dec 2020 22:10:42 +0100 Subject: [PATCH] Fix carrot param2 reset to 0 when ate by rabbit --- mods/ENTITIES/mcl_mobs/api.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index bfc4a7f95..af4a1cfe3 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -1544,10 +1544,11 @@ local replace = function(self, pos) pos.y = pos.y + y_offset - if #minetest.find_nodes_in_area(pos, pos, what) > 0 then + local node = minetest.get_node(pos) + if node.name == what then - local oldnode = {name = what} - local newnode = {name = with} + local oldnode = {name = what, param2 = node.param2} + local newnode = {name = with, param2 = node.param2} local on_replace_return if self.on_replace then @@ -1557,7 +1558,7 @@ local replace = function(self, pos) if on_replace_return ~= false then if mobs_griefing then - minetest.set_node(pos, {name = with}) + minetest.set_node(pos, newnode) end end