Delay head rotate packet for paper users to try avoid xray issue

This commit is contained in:
libraryaddict 2020-06-04 16:57:28 +12:00
parent ece93e7145
commit 2d53fdadd0
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4

View File

@ -386,10 +386,15 @@ public class PacketHandlerSpawn implements IPacketHandler {
if (packets.getPackets().size() <= 1 || disguise.isPlayerDisguise()) { if (packets.getPackets().size() <= 1 || disguise.isPlayerDisguise()) {
PacketContainer rotateHead = new PacketContainer(PacketType.Play.Server.ENTITY_HEAD_ROTATION); PacketContainer rotateHead = new PacketContainer(PacketType.Play.Server.ENTITY_HEAD_ROTATION);
packets.addPacket(rotateHead);
StructureModifier<Object> mods = rotateHead.getModifier(); StructureModifier<Object> mods = rotateHead.getModifier();
if (!DisguiseUtilities.isRunningPaper()) {
packets.addPacket(rotateHead);
} else {
packets.addDelayedPacket(rotateHead, 10);
}
mods.write(0, disguisedEntity.getEntityId()); mods.write(0, disguisedEntity.getEntityId());
mods.write(1, yaw); mods.write(1, yaw);
} }