Better save disguises, avoid nulls

This commit is contained in:
libraryaddict 2017-06-10 02:33:50 +12:00
parent 3d78b493bc
commit ee2fef7450

View File

@ -76,15 +76,14 @@ public class DisguiseUtilities {
private static BackwardMethods methods; private static BackwardMethods methods;
public static void saveDisguises() { public static void saveDisguises() {
Iterator<HashSet<TargetedDisguise>> itel = disguisesInUse.values().iterator(); for (HashSet<TargetedDisguise> list : disguisesInUse.values()) {
for (TargetedDisguise disg : list) {
if (disg.getEntity() == null)
continue;
while (itel.hasNext()) { saveDisguises(disg.getEntity().getUniqueId(), list.toArray(new Disguise[0]));
HashSet<TargetedDisguise> list = itel.next(); break;
}
if (list.isEmpty())
continue;
saveDisguises(list.iterator().next().getEntity().getUniqueId(), list.toArray(new Disguise[0]));
} }
} }