aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOwen <[email protected]>2022-09-24 01:45:13 -0400
committerGitHub <[email protected]>2022-09-24 06:45:13 +0100
commitb4c025b92c48fb2b55a7433f85627184aee5d90a (patch)
tree2746efb499adae1afd7ca03dce46bde1d211d808
parent62680d5f83467590ad26cc976ee48b9b2dda3d13 (diff)
downloadPaper-b4c025b92c48fb2b55a7433f85627184aee5d90a.tar.gz
Paper-b4c025b92c48fb2b55a7433f85627184aee5d90a.zip
Fix player desync on dimension change (#8253)
-rw-r--r--patches/server/0947-Set-position-before-player-sending-on-dimension-chan.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/patches/server/0947-Set-position-before-player-sending-on-dimension-chan.patch b/patches/server/0947-Set-position-before-player-sending-on-dimension-chan.patch
new file mode 100644
index 0000000000..56b75835df
--- /dev/null
+++ b/patches/server/0947-Set-position-before-player-sending-on-dimension-chan.patch
@@ -0,0 +1,20 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Owen1212055 <[email protected]>
+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 3615576c24d5d6790a6894a91180de25fa0e5a9c..a6fe628eb56833e79a05ce192a3848fc66db93c9 100644
+--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
+@@ -1156,6 +1156,7 @@ 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)