From a3778ffe9c785aaa0ec8e3a7d64b703654b62e37 Mon Sep 17 00:00:00 2001 From: Pyrbu Date: Thu, 11 May 2023 15:02:04 +0100 Subject: [PATCH] fix player head yaw --- .../src/main/java/lol/pyr/znpcsplus/packets/V1_14Factory.java | 4 +--- .../src/main/java/lol/pyr/znpcsplus/packets/V1_8Factory.java | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_14Factory.java b/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_14Factory.java index 48a13d6..af566dd 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_14Factory.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_14Factory.java @@ -2,10 +2,9 @@ package lol.pyr.znpcsplus.packets; import com.github.retrooper.packetevents.util.Vector3d; import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerSpawnEntity; +import lol.pyr.znpcsplus.api.entity.PropertyHolder; import lol.pyr.znpcsplus.entity.PacketEntity; import lol.pyr.znpcsplus.util.ZLocation; -import lol.pyr.znpcsplus.entity.EntityPropertyImpl; -import lol.pyr.znpcsplus.api.entity.PropertyHolder; import org.bukkit.entity.Player; import java.util.Optional; @@ -16,7 +15,6 @@ public class V1_14Factory extends V1_10Factory { ZLocation location = entity.getLocation(); sendPacket(player, new WrapperPlayServerSpawnEntity(entity.getEntityId(), Optional.of(entity.getUuid()), entity.getType(), location.toVector3d(), location.getPitch(), location.getYaw(), location.getYaw(), 0, Optional.of(new Vector3d()))); - if (properties.hasProperty(EntityPropertyImpl.GLOW)) createTeam(player, entity, properties); sendAllMetadata(player, entity, properties); createTeam(player, entity, properties); } diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_8Factory.java b/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_8Factory.java index d9d1bf6..984e0f6 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_8Factory.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_8Factory.java @@ -32,6 +32,7 @@ public class V1_8Factory implements PacketFactory { ZLocation location = entity.getLocation(); sendPacket(player, new WrapperPlayServerSpawnPlayer(entity.getEntityId(), entity.getUuid(), location.toVector3d(), location.getYaw(), location.getPitch(), Collections.emptyList())); + sendPacket(player, new WrapperPlayServerEntityHeadLook(entity.getEntityId(), location.getYaw())); sendAllMetadata(player, entity, properties); ZNpcsPlus.SCHEDULER.runLaterAsync(() -> removeTabPlayer(player, entity), 60); }); @@ -60,8 +61,7 @@ public class V1_8Factory implements PacketFactory { @Override public void teleportEntity(Player player, PacketEntity entity) { ZLocation location = entity.getLocation(); - sendPacket(player, new WrapperPlayServerEntityTeleport(entity.getEntityId(), - location.toVector3d(), location.getYaw(), location.getPitch(), true)); + sendPacket(player, new WrapperPlayServerEntityTeleport(entity.getEntityId(), location.toVector3d(), location.getYaw(), location.getPitch(), true)); } @Override