Use getRawValue() instead of getValue(), fixes #520
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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();
 | 
			
		||||
 
 | 
			
		||||
@@ -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)));
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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));
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user