2021-10-01 02:50:00 +02:00
|
|
|
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
|
2022-07-27 23:32:15 +02:00
|
|
|
index 37123198bdf0188f59f289a31570663938fdc3c1..71fd35d9d89d878109b0d4d0ae73a99063059eec 100644
|
2021-10-01 02:50:00 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
2022-07-27 23:32:15 +02:00
|
|
|
@@ -1749,6 +1749,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
2021-10-01 02:50:00 +02:00
|
|
|
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) {
|
2022-07-27 23:32:15 +02:00
|
|
|
@@ -1787,6 +1788,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
2021-10-01 02:50:00 +02:00
|
|
|
this.setXRot(pitch);
|
|
|
|
this.setOldPosAndRot();
|
|
|
|
this.reapplyPosition();
|
|
|
|
+ this.setYHeadRot(yaw); // Paper - Update head rotation
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void setOldPosAndRot() {
|