Paper/Spigot-Server-Patches/0475-Sync-position-on-teleportation.patch
Aikar c0d07c1b67
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
f009c3dd SPIGOT-5810, SPIGOT-5835: 'Better' handling of Player.isOnGround
e677c370 Update ECJ version
5058a35d SPIGOT-5860: Item.setItemStack should be NotNull

CraftBukkit Changes:
d77f4d9b SPIGOT-5810, SPIGOT-5835: 'Better' handling of Player.isOnGround
53c95627 SPIGOT-5865: Piglin does not trigger EntityPickupItemEvent
2ab04d24 Update ECJ version
7884e079 SPIGOT-5868: Blocks do not tick in custom nether / end
2a848286 SPIGOT-5863: Don't check colour in scoreboard length validation
f2cbce30 SPIGOT-5866: Beehive unknown TargetReason

Spigot Changes:
ad703da0 SPIGOT-5870: /plugins "website" field shows "version"
1a27cfd8 #98: Improve output of /plugins command using text components
732d5bab Disable checkstyle in Spigot blocks
0199a9a6 #97: Add Memory Usage to Ticks Per Second Command.
33ea98fc SPIGOT-5858: NPE: Joining the server with an invalid dimension
2020-06-27 21:54:05 -04:00

35 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
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
index 93536306c39c1ee574d45f39e8e40df3540c6e51..681de2638eb606185077668d87340f7258e2ad90 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -501,6 +501,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
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();
}
@@ -1300,6 +1301,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
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));
}