This commit is contained in:
libraryaddict 2021-07-11 04:42:33 +12:00
parent 60ff44e8b1
commit d94ed9b53a
2 changed files with 3 additions and 4 deletions

View File

@ -274,7 +274,7 @@ public class PlayerSkinHandler implements Listener {
PacketContainer teleport = new PacketContainer(PacketType.Play.Server.ENTITY_TELEPORT); PacketContainer teleport = new PacketContainer(PacketType.Play.Server.ENTITY_TELEPORT);
StructureModifier<Object> mods = teleport.getModifier(); StructureModifier<Object> mods = teleport.getModifier();
Location loc = disguise.getEntity().getLocation().add(0, disguise.getWatcher().getYModifier(), 0); Location loc = disguise.getEntity().getLocation().add(0, disguise.getWatcher().getYModifier() + DisguiseUtilities.getYModifier(disguise), 0);
Float pitchLock = DisguiseConfig.isMovementPacketsEnabled() ? disguise.getWatcher().getPitchLock() : null; Float pitchLock = DisguiseConfig.isMovementPacketsEnabled() ? disguise.getWatcher().getPitchLock() : null;
Float yawLock = DisguiseConfig.isMovementPacketsEnabled() ? disguise.getWatcher().getYawLock() : null; Float yawLock = DisguiseConfig.isMovementPacketsEnabled() ? disguise.getWatcher().getYawLock() : null;
@ -303,7 +303,7 @@ public class PlayerSkinHandler implements Listener {
mods.write(0, id); mods.write(0, id);
mods.write(1, loc.getX()); mods.write(1, loc.getX());
mods.write(2, loc.getY() + DisguiseUtilities.getYModifier(disguise)); mods.write(2, loc.getY());
mods.write(3, loc.getZ()); mods.write(3, loc.getZ());
mods.write(4, yaw); mods.write(4, yaw);
mods.write(5, pitch); mods.write(5, pitch);

View File

@ -180,8 +180,7 @@ public class PacketHandlerSpawn implements IPacketHandler {
skin.setSleepPackets(!normalPlayerDisguise); skin.setSleepPackets(!normalPlayerDisguise);
Location spawnAt = normalPlayerDisguise ? disguisedEntity.getLocation() : Location spawnAt = normalPlayerDisguise ? loc : observer.getLocation().add(observer.getLocation().getDirection().normalize().multiply(10));
observer.getLocation().add(observer.getLocation().getDirection().normalize().multiply(10));
// Spawn him in front of the observer // Spawn him in front of the observer
StructureModifier<Double> doubles = spawnPlayer.getDoubles(); StructureModifier<Double> doubles = spawnPlayer.getDoubles();