Fix multinames getting out of sync

This commit is contained in:
libraryaddict 2020-09-19 08:07:12 +12:00
parent a66b41e4f5
commit ae34cb33b6
3 changed files with 13 additions and 5 deletions

View File

@ -83,12 +83,12 @@
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version> <version>1.16.3-R0.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId> <artifactId>spigot</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version> <version>1.16.3-R0.1-SNAPSHOT</version>
</dependency> </dependency>
<!-- testing --> <!-- testing -->
<dependency> <dependency>

View File

@ -54,6 +54,10 @@ public class PacketHandlerMovement implements IPacketHandler {
double height = disguise.getHeight(); double height = disguise.getHeight();
for (PacketContainer packet : packets.getPackets()) { for (PacketContainer packet : packets.getPackets()) {
if (packet.getType() == PacketType.Play.Server.ENTITY_LOOK) {
continue;
}
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
int standId = disguise.getArmorstandIds()[i]; int standId = disguise.getArmorstandIds()[i];
PacketContainer packet2 = packet.shallowClone(); PacketContainer packet2 = packet.shallowClone();
@ -193,8 +197,12 @@ public class PacketHandlerMovement implements IPacketHandler {
if (entity == observer.getVehicle() && if (entity == observer.getVehicle() &&
AbstractHorse.class.isAssignableFrom(disguise.getType().getEntityClass())) { AbstractHorse.class.isAssignableFrom(disguise.getType().getEntityClass())) {
PacketContainer packet = movePacket.shallowClone(); PacketContainer packet = new PacketContainer(PacketType.Play.Server.ENTITY_LOOK);
packet.getModifier().write(0, DisguiseAPI.getEntityAttachmentId());
packet.getIntegers().write(0, DisguiseAPI.getEntityAttachmentId());
packet.getBytes().write(0, yawValue);
packet.getBytes().write(1, pitchValue);
packets.addPacket(packet); packets.addPacket(packet);
} else if (sentPacket.getType() == PacketType.Play.Server.ENTITY_TELEPORT && } else if (sentPacket.getType() == PacketType.Play.Server.ENTITY_TELEPORT &&
disguise.getType() == DisguiseType.ITEM_FRAME) { disguise.getType() == DisguiseType.ITEM_FRAME) {

View File

@ -75,7 +75,7 @@ public class PacketListenerViewSelfDisguise extends PacketAdapter {
PacketsManager.getPacketsHandler().transformPacket(packet, disguise, observer, observer); PacketsManager.getPacketsHandler().transformPacket(packet, disguise, observer, observer);
if (transformed.isUnhandled()) { if (transformed.isUnhandled()) {
transformed.getPackets().add(packet); transformed.addPacket(packet);
} }
for (PacketContainer newPacket : transformed.getPackets()) { for (PacketContainer newPacket : transformed.getPackets()) {