From 65d80b71f28c93e5b319306b88ba58f5f63f47ed Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 16 Jan 2021 00:45:49 +1300 Subject: [PATCH] Always send the packets if its not sleeping them --- .../packets/packethandlers/PacketHandlerSpawn.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java index 3c8c0a42..e23babe5 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java @@ -122,6 +122,8 @@ public class PacketHandlerSpawn implements IPacketHandler { pitch = DisguiseUtilities.getPitch(disguise.getType(), pitch); } + boolean normalPlayerDisguise = true; + if (disguise.getType() == DisguiseType.EXPERIENCE_ORB) { PacketContainer spawnOrb = new PacketContainer(PacketType.Play.Server.SPAWN_ENTITY_EXPERIENCE_ORB); packets.addPacket(spawnOrb); @@ -205,7 +207,7 @@ public class PacketHandlerSpawn implements IPacketHandler { double dist = observer.getLocation().distanceSquared(disguisedEntity.getLocation()); // If self disguise, or further than 50 blocks, or not in front of entity - boolean normalPlayerDisguise = observer == disguisedEntity || dist > (50 * 50) || + normalPlayerDisguise = observer == disguisedEntity || dist > (50 * 50) || (observer.getLocation().add(observer.getLocation().getDirection().normalize()).distanceSquared(disguisedEntity.getLocation()) - dist) < 0.3; sendArmor = normalPlayerDisguise; @@ -433,7 +435,7 @@ public class PacketHandlerSpawn implements IPacketHandler { packets.addPacket(newPacket); } - if (!disguise.isPlayerDisguise()) { + if (!disguise.isPlayerDisguise() || normalPlayerDisguise) { DisguiseUtilities.getNamePackets(disguise, new String[0]).forEach(packets::addPacket); }