Move the setting of watcher values for precaution down after a secondary watcher construction
This commit is contained in:
parent
d4c657eee6
commit
a2c8042f4c
@ -237,12 +237,6 @@ public class Disguise {
|
|||||||
if (watcher instanceof AgeableWatcher && this instanceof MobDisguise) {
|
if (watcher instanceof AgeableWatcher && this instanceof MobDisguise) {
|
||||||
((AgeableWatcher) watcher).setValue(12, ((MobDisguise) this).isAdult() ? 0 : -23999);
|
((AgeableWatcher) watcher).setValue(12, ((MobDisguise) this).isAdult() ? 0 : -23999);
|
||||||
}
|
}
|
||||||
WatcherValues entity = WatcherValues.valueOf(type.name());
|
|
||||||
WatcherValues disguise = WatcherValues.valueOf(getType().name());
|
|
||||||
for (int i : entity.getValues()) {
|
|
||||||
if (disguise.getValue(i) != null && disguise.getValue(i).getClass() != entity.getValue(i).getClass())
|
|
||||||
watcher.setValue(i, disguise.getValue(i));
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
if (throwError)
|
if (throwError)
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
@ -252,6 +246,13 @@ public class Disguise {
|
|||||||
else
|
else
|
||||||
watcher = new FlagWatcher(entityId);
|
watcher = new FlagWatcher(entityId);
|
||||||
}
|
}
|
||||||
|
WatcherValues entity = WatcherValues.valueOf(getType().name());
|
||||||
|
WatcherValues disguise = WatcherValues.valueOf(getType().name());
|
||||||
|
for (int i : entity.getValues()) {
|
||||||
|
if (disguise.getValue(i) != null && disguise.getValue(i).getClass() != entity.getValue(i).getClass())
|
||||||
|
// watcher.setValue(i, disguise.getValue(i));
|
||||||
|
watcher.setValue(i, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DisguiseType getType() {
|
public DisguiseType getType() {
|
||||||
|
Loading…
Reference in New Issue
Block a user