Don't let clients know dolphins can secretly walk, fixes dolphins acting curious and glancing about as you walk

This commit is contained in:
libraryaddict 2020-06-08 18:06:50 +12:00
parent 2d53fdadd0
commit a9ce0b0ee7
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4

@ -149,12 +149,12 @@ public class PacketHandlerMovement implements IPacketHandler {
statusPacket.getIntegers().write(0, entity.getEntityId());
statusPacket.getBytes().write(0, (byte) 1);
}
} else
} else if (sentPacket.getType() == PacketType.Play.Server.ENTITY_LOOK &&
disguise.getType() == DisguiseType.WITHER_SKULL) {
// Stop wither skulls from looking
if (sentPacket.getType() == PacketType.Play.Server.ENTITY_LOOK &&
disguise.getType() == DisguiseType.WITHER_SKULL) {
packets.clear();
} else if (sentPacket.getType() != PacketType.Play.Server.REL_ENTITY_MOVE) {
packets.clear();
} else {
if (sentPacket.getType() != PacketType.Play.Server.REL_ENTITY_MOVE) {
packets.clear();
PacketContainer movePacket = sentPacket.shallowClone();
@ -190,7 +190,19 @@ public class PacketHandlerMovement implements IPacketHandler {
if (y != 0) {
doubles.write(2, doubles.read(2) + y);
}
} else if (disguise.getType() == DisguiseType.DOLPHIN) {
movePacket.getBooleans().write(0, false);
}
} else if (disguise.getType() == DisguiseType.DOLPHIN) {
// Dolphins act funny on the ground, so lets not tell the clients they are on the ground
packets.clear();
PacketContainer movePacket = sentPacket.shallowClone();
packets.addPacket(movePacket);
movePacket.getBooleans().write(0, false);
}
}
}
}