Move player to correct position in vehicle move packet handler

We add the change to guarantee that the player position moves
in-sync with the vehicle's. As a result, it should be teleporting
the player using the new position of the vehicle rather than the
old.
This commit is contained in:
Spottedleaf
2025-06-24 02:09:39 -07:00
parent e454fef40e
commit d0e808f44c

View File

@@ -295,7 +295,7 @@
rootVehicle.absSnapTo(d, d1, d2, f, f1); rootVehicle.absSnapTo(d, d1, d2, f, f1);
+ // CraftBukkit start - fire PlayerMoveEvent TODO: this should be removed. + // CraftBukkit start - fire PlayerMoveEvent TODO: this should be removed.
+ this.player.absSnapTo(x, y, z, this.player.getYRot(), this.player.getXRot()); // Paper - TODO: This breaks alot of stuff + this.player.absSnapTo(d, d1, d2, this.player.getYRot(), this.player.getXRot()); // Paper - TODO: This breaks alot of stuff
+ org.bukkit.entity.Player player = this.getCraftPlayer(); + org.bukkit.entity.Player player = this.getCraftPlayer();
+ if (!this.hasMoved) { + if (!this.hasMoved) {
+ this.lastPosX = prevX; + this.lastPosX = prevX;