Use getRawValue() instead of getValue(), fixes #520
This commit is contained in:
@@ -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