From c732b373b7993d165d63c7dc51acbb5537d9ad24 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 11 Jan 2014 10:06:59 +1300 Subject: [PATCH] Prevents errors being thrown for unsupported method --- .../libraryaddict/disguise/utilities/PacketsManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/me/libraryaddict/disguise/utilities/PacketsManager.java b/src/me/libraryaddict/disguise/utilities/PacketsManager.java index 6da5126e..d50bbefc 100644 --- a/src/me/libraryaddict/disguise/utilities/PacketsManager.java +++ b/src/me/libraryaddict/disguise/utilities/PacketsManager.java @@ -805,8 +805,8 @@ public class PacketsManager { @Override public void onPacketSending(PacketEvent event) { // If the inventory is the players inventory - if (event.getPlayer().isOnline() && event.getPlayer().getVehicle() == null - && event.getPacket().getIntegers().read(0) == 0) { + if (!(event.getPlayer() instanceof com.comphenix.net.sf.cglib.proxy.Factory) + && event.getPlayer().getVehicle() == null && event.getPacket().getIntegers().read(0) == 0) { Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer(), event.getPlayer()); // If the player is disguised, views self disguises and is hiding a item. if (disguise != null && disguise.isSelfDisguiseVisible() @@ -888,7 +888,8 @@ public class PacketsManager { PacketType.Play.Client.WINDOW_CLICK) { @Override public void onPacketReceiving(final PacketEvent event) { - if (event.getPlayer().isOnline() && event.getPlayer().getVehicle() == null) { + if (!(event.getPlayer() instanceof com.comphenix.net.sf.cglib.proxy.Factory) + && event.getPlayer().getVehicle() == null) { Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer(), event.getPlayer()); // If player is disguised, views self disguises and has a inventory modifier if (disguise != null && disguise.isSelfDisguiseVisible()