From b5c8d69398aa6e425fa264cf797d1882a7e86342 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 24 Mar 2014 01:45:31 +1300 Subject: [PATCH] I forget why we delay them. I think I had a really really good reason. --- .../disguise/utilities/PacketsManager.java | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/src/me/libraryaddict/disguise/utilities/PacketsManager.java b/src/me/libraryaddict/disguise/utilities/PacketsManager.java index 9a83169d..32c0455a 100644 --- a/src/me/libraryaddict/disguise/utilities/PacketsManager.java +++ b/src/me/libraryaddict/disguise/utilities/PacketsManager.java @@ -712,37 +712,18 @@ public class PacketsManager { // 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); if (packets != null) { - final PacketContainer[] delayedPackets = new PacketContainer[packets.length > 0 ? packets.length - 1 - : 0]; for (int i = 0; i < packets.length; i++) { PacketContainer packet = packets[i]; if (packet.equals(event.getPacket())) { packet = packet.deepClone(); } packet.getModifier().write(0, fakeId); - if (i == 0) { - try { - ProtocolLibrary.getProtocolManager().sendServerPacket(observer, packet, false); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - } else { - delayedPackets[i - 1] = packet; + try { + ProtocolLibrary.getProtocolManager().sendServerPacket(observer, packet, false); + } catch (InvocationTargetException e) { + e.printStackTrace(); } } - if (delayedPackets.length > 0) { - Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { - public void run() { - try { - for (PacketContainer packet : delayedPackets) { - ProtocolLibrary.getProtocolManager().sendServerPacket(observer, packet, false); - } - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - } - }); - } } if (event.getPacketType() == PacketType.Play.Server.ENTITY_METADATA) { event.setPacket(event.getPacket().deepClone());