2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2020-05-03 20:28:45 +02:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Sun, 3 May 2020 14:25:55 -0400
|
|
|
|
Subject: [PATCH] Sync position on teleportation
|
|
|
|
|
|
|
|
We've seen many a cases where the "last good" x/y/z is desynced from
|
|
|
|
the x/y/z that is checked for moving too fast.
|
|
|
|
|
|
|
|
Theory is that when you have multiple movement packets queued up,
|
|
|
|
and the player is teleported after the first then the 2nd and 3rd come in,
|
|
|
|
it is triggering a massive movement velocity.
|
|
|
|
|
|
|
|
This will ensure that the servers position is synchronized anytime player is teleported.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2020-06-02 05:15:47 +02:00
|
|
|
index 294e9a47e21be0babad2ea3d2a9b3fc79083e350..45944cad9436dd309a6323f80a0c4c2f2bb6367b 100644
|
2020-05-03 20:28:45 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2020-05-07 01:30:47 +02:00
|
|
|
@@ -498,6 +498,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
2020-05-03 20:28:45 +02:00
|
|
|
this.o = this.teleportPos.x;
|
|
|
|
this.p = this.teleportPos.y;
|
|
|
|
this.q = this.teleportPos.z;
|
|
|
|
+ this.syncPosition(); // Paper
|
|
|
|
if (this.player.H()) {
|
|
|
|
this.player.I();
|
|
|
|
}
|
2020-05-15 01:05:00 +02:00
|
|
|
@@ -1277,6 +1278,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
2020-05-03 20:28:45 +02:00
|
|
|
|
|
|
|
this.A = this.e;
|
|
|
|
this.player.setLocation(d0, d1, d2, f, f1);
|
|
|
|
+ this.syncPosition(); // Paper
|
|
|
|
this.player.playerConnection.sendPacket(new PacketPlayOutPosition(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.teleportAwait));
|
|
|
|
}
|
|
|
|
|