From 4a27a4a4d9d65c84928f0d51b5a31408746944db Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Thu, 30 Sep 2021 20:50:00 -0400 Subject: [PATCH] Update head rotation in missing places (#5481) --- ...date-head-rotation-in-missing-places.patch | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 patches/server/0812-Update-head-rotation-in-missing-places.patch diff --git a/patches/server/0812-Update-head-rotation-in-missing-places.patch b/patches/server/0812-Update-head-rotation-in-missing-places.patch new file mode 100644 index 000000000..dfc0762ec --- /dev/null +++ b/patches/server/0812-Update-head-rotation-in-missing-places.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> +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 94857a736d2a16e8ade286c6f2ddf8bd798008eb..4f164f238177b5e2b18c76b7cc14596ec93409d1 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -1742,6 +1742,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n + 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) { +@@ -1780,6 +1781,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n + this.setXRot(pitch); + this.setOldPosAndRot(); + this.reapplyPosition(); ++ this.setYHeadRot(yaw); // Paper - Update head rotation + } + + public final void setOldPosAndRot() {