If packets are null. Remake the containers boy!

This commit is contained in:
libraryaddict 2014-03-24 01:52:39 +13:00
parent b5c8d69398
commit 4bc09faa37

View File

@ -711,7 +711,9 @@ public class PacketsManager {
if (fakeId > 0) { if (fakeId > 0) {
// Here I grab the packets to convert them to, So I can display them as if the disguise sent them. // Here I grab the packets to convert them to, So I can display them as if the disguise sent them.
PacketContainer[] packets = transformPacket(event.getPacket(), observer, observer); PacketContainer[] packets = transformPacket(event.getPacket(), observer, observer);
if (packets != null) { if (packets == null) {
packets = new PacketContainer[] { event.getPacket() };
}
for (int i = 0; i < packets.length; i++) { for (int i = 0; i < packets.length; i++) {
PacketContainer packet = packets[i]; PacketContainer packet = packets[i];
if (packet.equals(event.getPacket())) { if (packet.equals(event.getPacket())) {
@ -724,7 +726,6 @@ public class PacketsManager {
e.printStackTrace(); e.printStackTrace();
} }
} }
}
if (event.getPacketType() == PacketType.Play.Server.ENTITY_METADATA) { if (event.getPacketType() == PacketType.Play.Server.ENTITY_METADATA) {
event.setPacket(event.getPacket().deepClone()); event.setPacket(event.getPacket().deepClone());
Iterator<WrappedWatchableObject> itel = event.getPacket().getWatchableCollectionModifier().read(0) Iterator<WrappedWatchableObject> itel = event.getPacket().getWatchableCollectionModifier().read(0)