Always send the packets if its not sleeping them

This commit is contained in:
libraryaddict 2021-01-16 00:45:49 +13:00
parent 999c5f3f21
commit 65d80b71f2

View File

@ -122,6 +122,8 @@ public class PacketHandlerSpawn implements IPacketHandler {
pitch = DisguiseUtilities.getPitch(disguise.getType(), pitch); pitch = DisguiseUtilities.getPitch(disguise.getType(), pitch);
} }
boolean normalPlayerDisguise = true;
if (disguise.getType() == DisguiseType.EXPERIENCE_ORB) { if (disguise.getType() == DisguiseType.EXPERIENCE_ORB) {
PacketContainer spawnOrb = new PacketContainer(PacketType.Play.Server.SPAWN_ENTITY_EXPERIENCE_ORB); PacketContainer spawnOrb = new PacketContainer(PacketType.Play.Server.SPAWN_ENTITY_EXPERIENCE_ORB);
packets.addPacket(spawnOrb); packets.addPacket(spawnOrb);
@ -205,7 +207,7 @@ public class PacketHandlerSpawn implements IPacketHandler {
double dist = observer.getLocation().distanceSquared(disguisedEntity.getLocation()); double dist = observer.getLocation().distanceSquared(disguisedEntity.getLocation());
// If self disguise, or further than 50 blocks, or not in front of entity // 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; (observer.getLocation().add(observer.getLocation().getDirection().normalize()).distanceSquared(disguisedEntity.getLocation()) - dist) < 0.3;
sendArmor = normalPlayerDisguise; sendArmor = normalPlayerDisguise;
@ -433,7 +435,7 @@ public class PacketHandlerSpawn implements IPacketHandler {
packets.addPacket(newPacket); packets.addPacket(newPacket);
} }
if (!disguise.isPlayerDisguise()) { if (!disguise.isPlayerDisguise() || normalPlayerDisguise) {
DisguiseUtilities.getNamePackets(disguise, new String[0]).forEach(packets::addPacket); DisguiseUtilities.getNamePackets(disguise, new String[0]).forEach(packets::addPacket);
} }