diff --git a/src/me/libraryaddict/disguise/DisguiseAPI.java b/src/me/libraryaddict/disguise/DisguiseAPI.java index 7a79b402..80531909 100644 --- a/src/me/libraryaddict/disguise/DisguiseAPI.java +++ b/src/me/libraryaddict/disguise/DisguiseAPI.java @@ -38,16 +38,6 @@ public class DisguiseAPI { return hearSelfDisguise; } - public static void setInventoryListenerEnabled(boolean inventoryListenerEnabled) { - if (PacketsManager.isInventoryListenerEnabled() != inventoryListenerEnabled) { - PacketsManager.setInventoryListenerEnabled(inventoryListenerEnabled); - } - } - - public static boolean isInventoryListenerEnabled() { - return PacketsManager.isInventoryListenerEnabled(); - } - /** * Disguise the next entity to spawn with this disguise. This may not work however if the entity doesn't actually spawn. */ @@ -146,6 +136,10 @@ public class DisguiseAPI { return hidingHeldItem; } + public static boolean isInventoryListenerEnabled() { + return PacketsManager.isInventoryListenerEnabled(); + } + /** * Is the sound packets caught and modified */ @@ -246,6 +240,12 @@ public class DisguiseAPI { } } + public static void setInventoryListenerEnabled(boolean inventoryListenerEnabled) { + if (PacketsManager.isInventoryListenerEnabled() != inventoryListenerEnabled) { + PacketsManager.setInventoryListenerEnabled(inventoryListenerEnabled); + } + } + /** * Set if the disguises play sounds when hurt */ diff --git a/src/me/libraryaddict/disguise/PacketsManager.java b/src/me/libraryaddict/disguise/PacketsManager.java index 235d0ee2..52979b5f 100644 --- a/src/me/libraryaddict/disguise/PacketsManager.java +++ b/src/me/libraryaddict/disguise/PacketsManager.java @@ -73,16 +73,16 @@ import com.comphenix.protocol.events.PacketListener; import com.comphenix.protocol.reflect.StructureModifier; public class PacketsManager { + private static boolean cancelSound; + private static DisguiseAPI disguiseAPI = new DisguiseAPI(); private static PacketListener inventoryListenerClient; private static PacketListener inventoryListenerServer; private static boolean inventoryModifierEnabled; + private static LibsDisguises libsDisguises; private static PacketListener soundsListener; private static boolean soundsListenerEnabled; private static PacketListener viewDisguisesListener; private static boolean viewDisguisesListenerEnabled; - private static LibsDisguises libsDisguises; - private static DisguiseAPI disguiseAPI = new DisguiseAPI(); - private static boolean cancelSound; protected static void addPacketListeners(final JavaPlugin libsDisguises) { ProtocolManager manager = ProtocolLibrary.getProtocolManager(); @@ -612,8 +612,7 @@ public class PacketsManager { Packets.Server.REL_ENTITY_MOVE_LOOK, Packets.Server.ENTITY_LOOK, Packets.Server.ENTITY_TELEPORT, Packets.Server.ENTITY_HEAD_ROTATION, Packets.Server.ENTITY_METADATA, Packets.Server.ENTITY_EQUIPMENT, Packets.Server.ARM_ANIMATION, Packets.Server.ENTITY_LOCATION_ACTION, Packets.Server.MOB_EFFECT, - Packets.Server.ENTITY_STATUS, Packets.Server.ENTITY_VELOCITY, Packets.Server.UPDATE_ATTRIBUTES, - Packets.Server.BED) { + Packets.Server.ENTITY_STATUS, Packets.Server.ENTITY_VELOCITY, Packets.Server.UPDATE_ATTRIBUTES) { @Override public void onPacketSending(PacketEvent event) { StructureModifier entityModifer = event.getPacket().getEntityModifier(event.getPlayer().getWorld()); @@ -946,6 +945,18 @@ public class PacketsManager { }; } + public static boolean isHearDisguisesEnabled() { + return soundsListenerEnabled; + } + + public static boolean isInventoryListenerEnabled() { + return inventoryModifierEnabled; + } + + public static boolean isViewDisguisesListenerEnabled() { + return viewDisguisesListenerEnabled; + } + /** * Sends the self disguise to the player */ @@ -1043,18 +1054,6 @@ public class PacketsManager { } } - public static boolean isHearDisguisesEnabled() { - return soundsListenerEnabled; - } - - public static boolean isInventoryListenerEnabled() { - return inventoryModifierEnabled; - } - - public static boolean isViewDisguisesListenerEnabled() { - return viewDisguisesListenerEnabled; - } - public static void setHearDisguisesListener(boolean enabled) { if (soundsListenerEnabled != enabled) { soundsListenerEnabled = enabled; diff --git a/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java index a76e04ce..eb3ea188 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java @@ -51,8 +51,8 @@ public class FlagWatcher { } private Disguise disguise; private HashMap entityValues = new HashMap(); - private org.bukkit.inventory.ItemStack[] items = new org.bukkit.inventory.ItemStack[5]; private boolean hasDied; + private org.bukkit.inventory.ItemStack[] items = new org.bukkit.inventory.ItemStack[5]; public FlagWatcher(Disguise disguise) { this.disguise = disguise;