diff --git a/src/main/java/me/libraryaddict/disguise/LibsDisguises.java b/src/main/java/me/libraryaddict/disguise/LibsDisguises.java index 310f6f49..b89507ba 100644 --- a/src/main/java/me/libraryaddict/disguise/LibsDisguises.java +++ b/src/main/java/me/libraryaddict/disguise/LibsDisguises.java @@ -68,6 +68,8 @@ public class LibsDisguises extends JavaPlugin { return; } + ReflectionManager.init(); + PacketsManager.init(this); DisguiseUtilities.init(this); diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java index 852a93f7..12b59a56 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java @@ -544,8 +544,9 @@ public class FlagWatcher { public void setSneaking(boolean setSneaking) { setEntityFlag(1, setSneaking); - updatePose(); sendData(MetaIndex.ENTITY_META); + + updatePose(); } public boolean isSleeping() { diff --git a/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java b/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java index 9c6b3ff4..8ff43ecf 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java @@ -32,19 +32,19 @@ import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; public class ReflectionManager { - private static final String bukkitVersion = Bukkit.getServer().getClass().getName().split("\\.")[3]; - private static final Class craftItemClass; + private static String bukkitVersion = Bukkit.getServer().getClass().getName().split("\\.")[3]; + private static Class craftItemClass; private static Method damageAndIdleSoundMethod; - private static final Constructor boundingBoxConstructor; - private static final Method setBoundingBoxMethod; - private static final Field pingField; - public static final Field entityCountField; - private static final Field chunkMapField; - private static final Field chunkProviderField; - private static final Field entityTrackerField; - private static final Field trackedEntitiesField; + private static Constructor boundingBoxConstructor; + private static Method setBoundingBoxMethod; + private static Field pingField; + public static Field entityCountField; + private static Field chunkMapField; + private static Field chunkProviderField; + private static Field entityTrackerField; + private static Field trackedEntitiesField; - static { + public static void init() { try { Object entity = createEntityInstance(DisguiseType.COW, "Cow");