diff --git a/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index cf888d38..f25d05d3 100644 --- a/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -76,15 +76,14 @@ public class DisguiseUtilities { private static BackwardMethods methods; public static void saveDisguises() { - Iterator> itel = disguisesInUse.values().iterator(); + for (HashSet list : disguisesInUse.values()) { + for (TargetedDisguise disg : list) { + if (disg.getEntity() == null) + continue; - while (itel.hasNext()) { - HashSet list = itel.next(); - - if (list.isEmpty()) - continue; - - saveDisguises(list.iterator().next().getEntity().getUniqueId(), list.toArray(new Disguise[0])); + saveDisguises(disg.getEntity().getUniqueId(), list.toArray(new Disguise[0])); + break; + } } }