Skip to content

Commit

Permalink
Fix my fix of the enderdragon bug, actually doubling down on the bug..
Browse files Browse the repository at this point in the history
  • Loading branch information
libraryaddict committed Jan 5, 2025
1 parent ea0ab6a commit a1c7aa5
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,17 @@ private void constructSpawnPackets(final Player observer, LibsPackets packets, E
float pitch = (pitchLock == null ? disguisedEntity.getLocation().getPitch() : pitchLock);

if (DisguiseConfig.isMovementPacketsEnabled()) {
if (yawLock == null) {
yaw = DisguiseUtilities.getYaw(DisguiseType.getType(disguisedEntity.getType()), yaw);
if (yawLock != null) {
yaw = DisguiseUtilities.getYaw(disguise.getType(), yaw);
} else {
yaw = DisguiseUtilities.getYaw(disguise.getType(), DisguiseType.getType(disguisedEntity.getType()), yaw);
}

if (pitchLock == null) {
pitch = DisguiseUtilities.getPitch(DisguiseType.getType(disguisedEntity.getType()), pitch);
if (pitchLock != null) {
pitch = DisguiseUtilities.getPitch(disguise.getType(), pitch);
} else {
pitch = DisguiseUtilities.getPitch(disguise.getType(), DisguiseType.getType(disguisedEntity.getType()), pitch);
}

yaw = DisguiseUtilities.getYaw(disguise.getType(), yaw);
pitch = DisguiseUtilities.getPitch(disguise.getType(), pitch);
}

com.github.retrooper.packetevents.protocol.world.Location pLoc =
Expand Down Expand Up @@ -397,7 +398,7 @@ private PacketWrapper constructLivingPacket(Player observer, LibsPackets packets
PacketWrapper spawnEntity;
int entityId = observer == disguisedEntity ? DisguiseAPI.getSelfDisguiseId() : disguisedEntity.getEntityId();
com.github.retrooper.packetevents.protocol.world.Location location =
new com.github.retrooper.packetevents.protocol.world.Location(loc.getX(), loc.getY(), loc.getZ(), pitch, yaw);
new com.github.retrooper.packetevents.protocol.world.Location(loc.getX(), loc.getY(), loc.getZ(), yaw, pitch);

if (NmsVersion.v1_19_R1.isSupported()) {
spawnEntity = new WrapperPlayServerSpawnEntity(entityId, disguise.getUUID(), entityType, location, yaw, 0,
Expand Down

0 comments on commit a1c7aa5

Please sign in to comment.