Add basic support for the 1.21.2 minecart experiment #5134
+211
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a simple packet translator for the
ClientboundMoveMinecartPacket
. This packet, introduced in Minecraft 1.21.2, is used to move minecarts around when the new minecart experiment is enabled. Without this PR, minecarts using the new minecart behaviour don't move at all on Bedrock.Since Bedrock doesn't have a similar minecart experiment and doesn't support entity interpolation steps in the way they are described in this packet, the translator simply takes the last interpolation step and sends its data to the Bedrock client. This isn't a perfect solution, and especially in turns minecarts don't move perfectly along the rails, but it seems this is the best it gets for now.
Note: I've also tried interpolating between the steps on Geyser, which didn't work much better since I was unable to interpolate between ticks, and I tried sending the step with the biggest weight instead of the last interpolation step, which also didn't work much better.