Actually remove the unknown entity id. Not the known entity ids..

This commit is contained in:
libraryaddict 2014-06-04 14:20:02 +12:00
parent 239bc6d645
commit 87c0cb4a78
2 changed files with 9 additions and 4 deletions

View File

@ -420,10 +420,11 @@ public abstract class Disguise {
} }
} else { } else {
// Loop through the disguises because it could be used with a unknown entity id. // Loop through the disguises because it could be used with a unknown entity id.
Iterator<UUID> itel = disguises.keySet().iterator(); HashMap<Integer, HashSet<TargetedDisguise>> future = DisguiseUtilities.getFutureDisguises();
Iterator<Integer> itel = DisguiseUtilities.getFutureDisguises().keySet().iterator();
while (itel.hasNext()) { while (itel.hasNext()) {
UUID id = itel.next(); int id = itel.next();
if (disguises.get(id).remove(this) && disguises.get(id).isEmpty()) { if (future.get(id).remove(this) && future.get(id).isEmpty()) {
itel.remove(); itel.remove();
} }
} }

View File

@ -263,7 +263,7 @@ public class DisguiseUtilities {
} }
return null; return null;
} }
public static TargetedDisguise getDisguise(Player observer, Entity entity) { public static TargetedDisguise getDisguise(Player observer, Entity entity) {
UUID entityId = entity.getUniqueId(); UUID entityId = entity.getUniqueId();
if (futureDisguises.containsKey(entity.getEntityId())) { if (futureDisguises.containsKey(entity.getEntityId())) {
@ -293,6 +293,10 @@ public class DisguiseUtilities {
return new TargetedDisguise[0]; return new TargetedDisguise[0];
} }
public static HashMap<Integer, HashSet<TargetedDisguise>> getFutureDisguises() {
return futureDisguises;
}
public static Object getGameProfile(String playerName) { public static Object getGameProfile(String playerName) {
return gameProfiles.get(playerName); return gameProfiles.get(playerName);
} }