1
0
Fork 0

Fix carrot param2 reset to 0 when ate by rabbit

This commit is contained in:
Wuzzy 2020-12-09 22:10:42 +01:00
parent d17c53cb0c
commit d699459bac
1 changed files with 5 additions and 4 deletions

View File

@ -1544,10 +1544,11 @@ local replace = function(self, pos)
pos.y = pos.y + y_offset 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 oldnode = {name = what, param2 = node.param2}
local newnode = {name = with} local newnode = {name = with, param2 = node.param2}
local on_replace_return local on_replace_return
if self.on_replace then if self.on_replace then
@ -1557,7 +1558,7 @@ local replace = function(self, pos)
if on_replace_return ~= false then if on_replace_return ~= false then
if mobs_griefing then if mobs_griefing then
minetest.set_node(pos, {name = with}) minetest.set_node(pos, newnode)
end end
end end