From 87c0cb4a78c19df9a4eff57c27b5a387e2e53d99 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Wed, 4 Jun 2014 14:20:02 +1200 Subject: [PATCH] Actually remove the unknown entity id. Not the known entity ids.. --- src/me/libraryaddict/disguise/disguisetypes/Disguise.java | 7 ++++--- .../disguise/utilities/DisguiseUtilities.java | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/Disguise.java b/src/me/libraryaddict/disguise/disguisetypes/Disguise.java index cf6b01aa..9e5c2d3e 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/src/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -420,10 +420,11 @@ public abstract class Disguise { } } else { // Loop through the disguises because it could be used with a unknown entity id. - Iterator itel = disguises.keySet().iterator(); + HashMap> future = DisguiseUtilities.getFutureDisguises(); + Iterator itel = DisguiseUtilities.getFutureDisguises().keySet().iterator(); while (itel.hasNext()) { - UUID id = itel.next(); - if (disguises.get(id).remove(this) && disguises.get(id).isEmpty()) { + int id = itel.next(); + if (future.get(id).remove(this) && future.get(id).isEmpty()) { itel.remove(); } } diff --git a/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index 20e155f6..8ee8cd4a 100644 --- a/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -263,7 +263,7 @@ public class DisguiseUtilities { } return null; } - + public static TargetedDisguise getDisguise(Player observer, Entity entity) { UUID entityId = entity.getUniqueId(); if (futureDisguises.containsKey(entity.getEntityId())) { @@ -293,6 +293,10 @@ public class DisguiseUtilities { return new TargetedDisguise[0]; } + public static HashMap> getFutureDisguises() { + return futureDisguises; + } + public static Object getGameProfile(String playerName) { return gameProfiles.get(playerName); }