#1232: Re-add fix for player rotation

This commit is contained in:
Owen1212055 2023-07-25 18:52:51 +10:00 committed by md_5
parent 7cf863de17
commit a2fafdd1d2
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -113,15 +113,23 @@
if (!collection.isEmpty()) { if (!collection.isEmpty()) {
consumer.accept(new PacketPlayOutUpdateAttributes(this.entity.getId(), collection)); consumer.accept(new PacketPlayOutUpdateAttributes(this.entity.getId(), collection));
} }
@@ -300,6 +339,7 @@ @@ -300,8 +339,15 @@
if (!list.isEmpty()) { if (!list.isEmpty()) {
consumer.accept(new PacketPlayOutEntityEquipment(this.entity.getId(), list)); consumer.accept(new PacketPlayOutEntityEquipment(this.entity.getId(), list));
} }
+ ((EntityLiving) this.entity).detectEquipmentUpdates(); // CraftBukkit - SPIGOT-3789: sync again immediately after sending + ((EntityLiving) this.entity).detectEquipmentUpdates(); // CraftBukkit - SPIGOT-3789: sync again immediately after sending
} }
+ // CraftBukkit start - MC-109346: Fix for nonsensical head yaw
+ if (this.entity instanceof EntityPlayer) {
+ consumer.accept(new PacketPlayOutEntityHeadRotation(this.entity, (byte) MathHelper.floor(this.entity.getYHeadRot() * 256.0F / 360.0F)));
+ }
+ // CraftBukkit end
+
if (!this.entity.getPassengers().isEmpty()) { if (!this.entity.getPassengers().isEmpty()) {
@@ -333,6 +373,11 @@ consumer.accept(new PacketPlayOutMount(this.entity));
}
@@ -333,6 +379,11 @@
Set<AttributeModifiable> set = ((EntityLiving) this.entity).getAttributes().getDirtyAttributes(); Set<AttributeModifiable> set = ((EntityLiving) this.entity).getAttributes().getDirtyAttributes();
if (!set.isEmpty()) { if (!set.isEmpty()) {