Set the values of the new flag watcher

This commit is contained in:
Andrew 2013-07-12 06:37:35 +12:00
parent fe07ea3e9f
commit bb04421378

View File

@ -32,7 +32,7 @@ import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.reflect.StructureModifier;
public class Disguise {
protected DisguiseType disguiseType;
private DisguiseType disguiseType;
private boolean replaceSounds;
private FlagWatcher watcher;
@ -246,12 +246,15 @@ public class Disguise {
else
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);
HashMap<Integer, Object> entity = Values.getMetaValues(DisguiseType.getType(type));
HashMap<Integer, Object> disguise = Values.getMetaValues(getType());
for (int i : entity.keySet()) {
if (!disguise.containsKey(i) || entity.get(i) != disguise.get(i) || entity.get(i).getClass() != disguise.get(i)) {
if (disguise.containsKey(i))
watcher.setValue(i, disguise.get(i));
else
watcher.setValue(i, null);
}
}
}