aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0615-Update-head-rotation-in-missing-places.patch
blob: 201c4c942d2aa3e5ad3991c47b2053eacaeca261 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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 9755d8a40a5a5b4863ce057f576f393773cee3e4..2ab2cfddae9f1bb3a1ca3c3bfd0916a14409b205 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1915,6 +1915,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) {
@@ -1957,6 +1958,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() {