-
Bug
-
Resolution: Unresolved
-
None
-
24w36a
-
Community Consensus
-
Minecart
-
Important
-
Platform
Since 24w34a, in the "Minecart Improvements" Experiment: Minecarts snap to positions on sloped rails as if the rails are sloped the opposite direction.
See attachments "test_setup", "align_carts", and "snap_carts" for visual showcase of the bug. When the cart falls above the higher part of the rail, it snaps lower in the block, and when the cart falls above the lower part of the rail, it snaps higher in the block.
The cause of this bug is a effectively a flipped sign in the math; a certain vector is added when it should be subtracted. The attached image called "excerpt" (taken from net.minecraft.world.entity.vehicle.NewMinecartBehavior#adjustToRails) shows the error highlighted. In that image: bl5 is true when the rail below the cart is sloped. Changing the highlighted method to subtract(vec34) — or equivalently add(vec34.reverse()) — fixes the snapping height issue.
See the "fixed_snapping" image to see what the behavior looks like when the fix is applied (done in 24w34a using a fabric mixin).