From aba5839fdec9ec853ce780572682ae21703c06e7 Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Sat, 24 Sep 2022 01:45:13 -0400 Subject: [PATCH] Fix player desync on dimension change (#8253) --- ...ore-player-sending-on-dimension-chan.patch | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 patches/server/Set-position-before-player-sending-on-dimension-chan.patch diff --git a/patches/server/Set-position-before-player-sending-on-dimension-chan.patch b/patches/server/Set-position-before-player-sending-on-dimension-chan.patch new file mode 100644 index 0000000000..785799af51 --- /dev/null +++ b/patches/server/Set-position-before-player-sending-on-dimension-chan.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> +Date: Sat, 6 Aug 2022 18:10:14 -0400 +Subject: [PATCH] Set position before player sending on dimension change + +This causes a moment where the player entity is sent with the previous location, and the +teleport packet which is sent shortly after is meant to correct that. + +diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java ++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { + + // CraftBukkit end + this.setLevel(worldserver); ++ this.moveTo(exit.getX(), exit.getY(), exit.getZ(), exit.getYaw(), exit.getPitch()); // Paper - Set the location before + worldserver.addDuringPortalTeleport(this); + this.connection.teleport(exit); // CraftBukkit - use internal teleport without event + this.connection.resetPosition(); // CraftBukkit - sync position after changing it (from PortalTravelAgent#findAndteleport)