Handle edge case in mcl_minecarts.reverse_cart_direction() that lead to strange punching and pushing behavior

This commit is contained in:
teknomunk 2024-12-29 09:17:35 -06:00 committed by the-real-herowl
parent 31066caf06
commit cacc9d384f

@ -504,6 +504,10 @@ function mod.get_cart_position(cart_staticdata)
end
function mod.reverse_cart_direction(staticdata)
if staticdata.distance == 0 then
staticdata.dir = -staticdata.dir
return
end
-- Complete moving thru this block into the next, reverse direction, and put us back at the same position we were at
local next_dir = -staticdata.dir