Better save disguises, avoid nulls
This commit is contained in:
		| @@ -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) { | ||||||
|         while (itel.hasNext()) { |                 if (disg.getEntity() == null) | ||||||
|             HashSet<TargetedDisguise> list = itel.next(); |  | ||||||
|  |  | ||||||
|             if (list.isEmpty()) |  | ||||||
|                     continue; |                     continue; | ||||||
|  |  | ||||||
|             saveDisguises(list.iterator().next().getEntity().getUniqueId(), list.toArray(new Disguise[0])); |                 saveDisguises(disg.getEntity().getUniqueId(), list.toArray(new Disguise[0])); | ||||||
|  |                 break; | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user