From 1e79aa9b3766f1e344d1a505d23f4bae6c13cee3 Mon Sep 17 00:00:00 2001 From: Roman Alexander Date: Sun, 14 May 2023 10:37:44 +0700 Subject: [PATCH] Update AddEntityPacket to include headYaw (#3762) --- .../main/java/org/geysermc/geyser/entity/type/Entity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/Entity.java b/core/src/main/java/org/geysermc/geyser/entity/type/Entity.java index e0f8c5a49..6ada880ce 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/Entity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/Entity.java @@ -36,6 +36,7 @@ import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; import net.kyori.adventure.text.Component; +import org.cloudburstmc.math.vector.Vector2f; import org.cloudburstmc.math.vector.Vector3f; import org.cloudburstmc.protocol.bedrock.data.entity.EntityDataTypes; import org.cloudburstmc.protocol.bedrock.data.entity.EntityEventType; @@ -171,7 +172,9 @@ public class Entity implements GeyserEntity { addEntityPacket.setUniqueEntityId(geyserId); addEntityPacket.setPosition(position); addEntityPacket.setMotion(motion); - addEntityPacket.setRotation(getBedrockRotation().toVector2(false)); // TODO: Check this + addEntityPacket.setRotation(Vector2f.from(pitch, yaw)); + addEntityPacket.setHeadRotation(headYaw); + addEntityPacket.setBodyRotation(yaw); // TODO: This should be bodyYaw addEntityPacket.getMetadata().putFlags(flags); dirtyMetadata.apply(addEntityPacket.getMetadata()); addAdditionalSpawnData(addEntityPacket);