diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java index 2201ac75..84a14678 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java @@ -295,7 +295,7 @@ public class FlagWatcher { if (value != null) { if (isEntityAnimationsAdded() && id == MetaIndex.ENTITY_META.getIndex()) { - value = addEntityAnimations((byte) value, (byte) watch.getValue()); + value = addEntityAnimations((byte) value, (byte) watch.getRawValue()); doSneakCheck((Byte) value); } @@ -314,7 +314,7 @@ public class FlagWatcher { } else { boolean isDirty = watch.getDirtyState(); - watch = ReflectionManager.createWatchable(MetaIndex.getMetaIndex(this, id), watch.getValue()); + watch = ReflectionManager.createWatchable(MetaIndex.getMetaIndex(this, id), watch.getRawValue()); if (watch == null) { continue; @@ -325,7 +325,7 @@ public class FlagWatcher { } if (id == MetaIndex.ENTITY_META.getIndex()) { - doSneakCheck((Byte) watch.getValue()); + doSneakCheck((Byte) watch.getRawValue()); } } @@ -361,7 +361,7 @@ public class FlagWatcher { for (WrappedWatchableObject watch : newList) { // Its a health packet if (watch.getIndex() == MetaIndex.LIVING_HEALTH.getIndex()) { - Object value = watch.getValue(); + Object value = watch.getRawValue(); if (value instanceof Float) { float newHealth = (Float) value; diff --git a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index e287bbb0..15ab0885 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -2786,16 +2786,18 @@ public class DisguiseUtilities { continue; } - if (watchableObject.getValue() == null) { + Object object = watchableObject.getRawValue(); + + if (object == null) { continue; } MetaIndex metaIndex = MetaIndex.getMetaIndex(disguiseWatcher, watchableObject.getIndex()); WrappedDataWatcher.WrappedDataWatcherObject obj = - ReflectionManager.createDataWatcherObject(metaIndex, watchableObject.getValue()); + ReflectionManager.createDataWatcherObject(metaIndex, object); - newWatcher.setObject(obj, watchableObject.getValue()); + newWatcher.setObject(obj, object); } } catch (Exception ex) { ex.printStackTrace(); diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java index 1e1cda74..f795bfe7 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java @@ -196,7 +196,7 @@ public class PacketHandlerEquipment implements IPacketHandler { if (NmsVersion.v1_13.isSupported()) { watcher.setValue((byte) 0); } else { - watcher.setValue((byte) ((byte) watcher.getValue() & ~(1 << 4))); + watcher.setValue((byte) ((byte) watcher.getRawValue() & ~(1 << 4))); } } diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java index e90e6587..897df6c4 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java @@ -122,7 +122,7 @@ public class PacketListenerViewSelfDisguise extends PacketAdapter { continue; } - byte b = (byte) watch.getValue(); + byte b = (byte) watch.getRawValue(); // Add invisibility, remove glowing byte a = (byte) ((b | 1 << 5) & ~(1 << 6)); 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 d5f51dd1..afd4fcc5 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java @@ -1858,7 +1858,7 @@ public class ReflectionManager { indexes.remove(flagType); Object ourValue = ReflectionManager.convertInvalidMeta(flagType.getDefault()); - Object nmsValue = ReflectionManager.convertInvalidMeta(watch.getValue()); + Object nmsValue = ReflectionManager.convertInvalidMeta(watch.getRawValue()); if (ourValue.getClass() != nmsValue.getClass()) { if (!loggedName) {