mirror of
https://github.com/TotalFreedomMC/TF-LibsDisguises.git
synced 2025-02-12 03:57:03 +00:00
Try handle player skins better
This commit is contained in:
parent
67a873b37f
commit
3d0c209cf7
1 changed files with 6 additions and 4 deletions
|
@ -210,10 +210,12 @@ public class PacketHandlerSpawn implements IPacketHandler {
|
|||
spawnPlayer.getIntegers().write(0, entityId); // Id
|
||||
spawnPlayer.getModifier().write(1, spawnProfile.getUUID());
|
||||
|
||||
boolean spawnFarAway = observer == disguisedEntity ||
|
||||
observer.getLocation().distanceSquared(disguisedEntity.getLocation()) >
|
||||
observer.getLocation().add(observer.getLocation().getDirection())
|
||||
.distanceSquared(disguisedEntity.getLocation());
|
||||
double dist = observer.getLocation().distanceSquared(disguisedEntity.getLocation());
|
||||
|
||||
// If self disguise, or further than 64 blocks, or not in front of entity
|
||||
boolean spawnFarAway = observer == disguisedEntity || dist > (64 * 64) ||
|
||||
(observer.getLocation().add(observer.getLocation().getDirection().normalize())
|
||||
.distanceSquared(disguisedEntity.getLocation()) - dist) < 0.3;
|
||||
|
||||
skin.setSleepPackets(!spawnFarAway);
|
||||
|
||||
|
|
Loading…
Reference in a new issue