Use getRawValue() instead of getValue(), fixes #520
This commit is contained in:
parent
a9bec1ef93
commit
4ef142b098
@ -295,7 +295,7 @@ public class FlagWatcher {
|
|||||||
|
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
if (isEntityAnimationsAdded() && id == MetaIndex.ENTITY_META.getIndex()) {
|
if (isEntityAnimationsAdded() && id == MetaIndex.ENTITY_META.getIndex()) {
|
||||||
value = addEntityAnimations((byte) value, (byte) watch.getValue());
|
value = addEntityAnimations((byte) value, (byte) watch.getRawValue());
|
||||||
|
|
||||||
doSneakCheck((Byte) value);
|
doSneakCheck((Byte) value);
|
||||||
}
|
}
|
||||||
@ -314,7 +314,7 @@ public class FlagWatcher {
|
|||||||
} else {
|
} else {
|
||||||
boolean isDirty = watch.getDirtyState();
|
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) {
|
if (watch == null) {
|
||||||
continue;
|
continue;
|
||||||
@ -325,7 +325,7 @@ public class FlagWatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (id == MetaIndex.ENTITY_META.getIndex()) {
|
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) {
|
for (WrappedWatchableObject watch : newList) {
|
||||||
// Its a health packet
|
// Its a health packet
|
||||||
if (watch.getIndex() == MetaIndex.LIVING_HEALTH.getIndex()) {
|
if (watch.getIndex() == MetaIndex.LIVING_HEALTH.getIndex()) {
|
||||||
Object value = watch.getValue();
|
Object value = watch.getRawValue();
|
||||||
|
|
||||||
if (value instanceof Float) {
|
if (value instanceof Float) {
|
||||||
float newHealth = (Float) value;
|
float newHealth = (Float) value;
|
||||||
|
@ -2786,16 +2786,18 @@ public class DisguiseUtilities {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (watchableObject.getValue() == null) {
|
Object object = watchableObject.getRawValue();
|
||||||
|
|
||||||
|
if (object == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaIndex metaIndex = MetaIndex.getMetaIndex(disguiseWatcher, watchableObject.getIndex());
|
MetaIndex metaIndex = MetaIndex.getMetaIndex(disguiseWatcher, watchableObject.getIndex());
|
||||||
|
|
||||||
WrappedDataWatcher.WrappedDataWatcherObject obj =
|
WrappedDataWatcher.WrappedDataWatcherObject obj =
|
||||||
ReflectionManager.createDataWatcherObject(metaIndex, watchableObject.getValue());
|
ReflectionManager.createDataWatcherObject(metaIndex, object);
|
||||||
|
|
||||||
newWatcher.setObject(obj, watchableObject.getValue());
|
newWatcher.setObject(obj, object);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
|
@ -196,7 +196,7 @@ public class PacketHandlerEquipment implements IPacketHandler {
|
|||||||
if (NmsVersion.v1_13.isSupported()) {
|
if (NmsVersion.v1_13.isSupported()) {
|
||||||
watcher.setValue((byte) 0);
|
watcher.setValue((byte) 0);
|
||||||
} else {
|
} 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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte b = (byte) watch.getValue();
|
byte b = (byte) watch.getRawValue();
|
||||||
|
|
||||||
// Add invisibility, remove glowing
|
// Add invisibility, remove glowing
|
||||||
byte a = (byte) ((b | 1 << 5) & ~(1 << 6));
|
byte a = (byte) ((b | 1 << 5) & ~(1 << 6));
|
||||||
|
@ -1858,7 +1858,7 @@ public class ReflectionManager {
|
|||||||
indexes.remove(flagType);
|
indexes.remove(flagType);
|
||||||
|
|
||||||
Object ourValue = ReflectionManager.convertInvalidMeta(flagType.getDefault());
|
Object ourValue = ReflectionManager.convertInvalidMeta(flagType.getDefault());
|
||||||
Object nmsValue = ReflectionManager.convertInvalidMeta(watch.getValue());
|
Object nmsValue = ReflectionManager.convertInvalidMeta(watch.getRawValue());
|
||||||
|
|
||||||
if (ourValue.getClass() != nmsValue.getClass()) {
|
if (ourValue.getClass() != nmsValue.getClass()) {
|
||||||
if (!loggedName) {
|
if (!loggedName) {
|
||||||
|
Loading…
Reference in New Issue
Block a user