From 42778bb214802db95cccbc52f78d42d820c5cda8 Mon Sep 17 00:00:00 2001 From: Likaos Date: Sat, 13 Sep 2014 20:45:17 +0200 Subject: [PATCH] Return if packet is already cancelled --- src/me/libraryaddict/disguise/utilities/PacketsManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/me/libraryaddict/disguise/utilities/PacketsManager.java b/src/me/libraryaddict/disguise/utilities/PacketsManager.java index 5bb5c1b2..af5c10ae 100644 --- a/src/me/libraryaddict/disguise/utilities/PacketsManager.java +++ b/src/me/libraryaddict/disguise/utilities/PacketsManager.java @@ -77,6 +77,7 @@ public class PacketsManager { PacketType.Play.Client.USE_ENTITY) { @Override public void onPacketReceiving(PacketEvent event) { + if (event.isCancelled()) return; try { Player observer = event.getPlayer(); StructureModifier entityModifer = event.getPacket().getEntityModifier(observer.getWorld()); @@ -739,6 +740,7 @@ public class PacketsManager { PacketType.Play.Server.UPDATE_ATTRIBUTES, PacketType.Play.Server.ENTITY_STATUS) { @Override public void onPacketSending(PacketEvent event) { + if (event.isCancelled()) return; final Player observer = event.getPlayer(); if (event.getPacket().getIntegers().read(0) == observer.getEntityId()) { if (DisguiseAPI.isSelfDisguised(observer)) { @@ -816,6 +818,7 @@ public class PacketsManager { PacketType.Play.Client.SET_CREATIVE_SLOT, PacketType.Play.Client.WINDOW_CLICK) { @Override public void onPacketReceiving(final PacketEvent event) { + if (event.isCancelled()) return; if (!(event.getPlayer() instanceof com.comphenix.net.sf.cglib.proxy.Factory) && event.getPlayer().getVehicle() == null) { Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer(), event.getPlayer()); @@ -1144,6 +1147,7 @@ public class PacketsManager { mainListener = new PacketAdapter(libsDisguises, ListenerPriority.HIGH, packetsToListen) { @Override public void onPacketSending(PacketEvent event) { + if (event.isCancelled()) return; final Player observer = event.getPlayer(); // First get the entity, the one sending this packet StructureModifier entityModifer = event.getPacket().getEntityModifier(observer.getWorld());