Send rel look for 1.15 head rotation packet

This commit is contained in:
libraryaddict 2020-03-02 12:54:05 +13:00
parent f28e520b09
commit 7c89c9ca50
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4

View File

@ -24,7 +24,10 @@ public class PacketHandlerHeadRotation implements IPacketHandler {
@Override @Override
public void handle(Disguise disguise, PacketContainer sentPacket, LibsPackets packets, Player observer, public void handle(Disguise disguise, PacketContainer sentPacket, LibsPackets packets, Player observer,
Entity entity) { Entity entity) {
if (disguise.getType().isPlayer() && entity.getType() != EntityType.PLAYER) { if (!disguise.getType().isPlayer() || entity.getType() == EntityType.PLAYER) {
return;
}
Location loc = entity.getLocation(); Location loc = entity.getLocation();
byte pitch = DisguiseUtilities byte pitch = DisguiseUtilities
@ -38,7 +41,7 @@ public class PacketHandlerHeadRotation implements IPacketHandler {
mods.write(0, entity.getEntityId()); mods.write(0, entity.getEntityId());
mods.write(1, yaw); mods.write(1, yaw);
PacketContainer look = new PacketContainer(PacketType.Play.Server.ENTITY_LOOK); PacketContainer look = new PacketContainer(PacketType.Play.Server.REL_ENTITY_MOVE_LOOK);
look.getIntegers().write(0, entity.getEntityId()); look.getIntegers().write(0, entity.getEntityId());
look.getBytes().write(0, yaw); look.getBytes().write(0, yaw);
@ -49,5 +52,4 @@ public class PacketHandlerHeadRotation implements IPacketHandler {
packets.addPacket(look); packets.addPacket(look);
packets.addPacket(rotation); packets.addPacket(rotation);
} }
}
} }