From 771a827e338bf062c6f7dd0d201fd0c026422c0d Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 14 Dec 2021 21:58:43 +1300 Subject: [PATCH] Fix an error with disguising non-livin as livin --- .../libraryaddict/disguise/disguisetypes/FlagWatcher.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java index 9a68244c..6271f51e 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java @@ -273,11 +273,12 @@ public class FlagWatcher { // Its sending the air metadata. This is the least commonly sent metadata which all entitys still share. // I send my custom values if I see this! - if (id == MetaIndex.ENTITY_AIR_TICKS.getIndex()) { + if (index == MetaIndex.ENTITY_AIR_TICKS) { sendAllCustom = true; } Object value = null; + boolean usingBackup = false; if (entityValues.containsKey(id)) { if (entityValues.get(id) == null) { @@ -286,7 +287,7 @@ public class FlagWatcher { value = entityValues.get(id); - if (id == MetaIndex.LIVING_HEALTH.getIndex() && (float) watch.getRawValue() <= 0) { + if (index == MetaIndex.LIVING_HEALTH && (float) watch.getRawValue() <= 0) { value = watch.getRawValue(); } } else if (backupEntityValues.containsKey(id)) { @@ -295,10 +296,11 @@ public class FlagWatcher { } value = backupEntityValues.get(id); + usingBackup = true; } if (value != null) { - if (isEntityAnimationsAdded() && (index == MetaIndex.ENTITY_META || index == MetaIndex.LIVING_META)) { + if (isEntityAnimationsAdded() && (index == MetaIndex.ENTITY_META || (index == MetaIndex.LIVING_META && !usingBackup))) { value = addEntityAnimations(index, (byte) value, (byte) watch.getRawValue()); if (index == MetaIndex.ENTITY_META) {