aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0622-Update-head-rotation-in-missing-places.patch
diff options
context:
space:
mode:
authorNewwind <[email protected]>2024-08-31 19:29:50 +0100
committerGitHub <[email protected]>2024-08-31 20:29:50 +0200
commit509ea2fd17fa03ce04f86046098607733b8767ba (patch)
tree3f7c9a29481fafbb6ad9f846839ec8f4863d2363 /patches/server/0622-Update-head-rotation-in-missing-places.patch
parente01ddf46279fbb68d157749a906b7a2ecc60da1a (diff)
downloadPaper-509ea2fd17fa03ce04f86046098607733b8767ba.tar.gz
Paper-509ea2fd17fa03ce04f86046098607733b8767ba.zip
Fix horse armor desync (#11341)
Diffstat (limited to 'patches/server/0622-Update-head-rotation-in-missing-places.patch')
-rw-r--r--patches/server/0622-Update-head-rotation-in-missing-places.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/patches/server/0622-Update-head-rotation-in-missing-places.patch b/patches/server/0622-Update-head-rotation-in-missing-places.patch
new file mode 100644
index 0000000000..a1c7566dc6
--- /dev/null
+++ b/patches/server/0622-Update-head-rotation-in-missing-places.patch
@@ -0,0 +1,29 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Owen1212055 <[email protected]>
+Date: Mon, 21 Jun 2021 21:55:23 -0400
+Subject: [PATCH] Update head rotation in missing places
+
+In certain areas the player's head rotation could be desynced when teleported/moved.
+This is because bukkit uses a separate head rotation field for yaw.
+This issue only applies to players.
+
+diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
+index f21bf6c8bbf30c59f1588c2105dbd7f80c07a0f1..e34260c80d19869c9bec5ba67f7ce7db9d13a1f1 100644
+--- a/src/main/java/net/minecraft/world/entity/Entity.java
++++ b/src/main/java/net/minecraft/world/entity/Entity.java
+@@ -1844,6 +1844,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+ this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F);
+ this.yRotO = this.getYRot();
+ this.xRotO = this.getXRot();
++ this.setYHeadRot(yaw); // Paper - Update head rotation
+ }
+
+ public void absMoveTo(double x, double y, double z) {
+@@ -1886,6 +1887,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+ this.setXRot(pitch);
+ this.setOldPosAndRot();
+ this.reapplyPosition();
++ this.setYHeadRot(yaw); // Paper - Update head rotation
+ }
+
+ public final void setOldPosAndRot() {