From ce76bb47c5f658bcfab32a007fdf00eabea39801 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 23 Nov 2013 04:39:35 +1300 Subject: [PATCH] Fixed a error which happened rarely --- src/me/libraryaddict/disguise/DisguiseAPI.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/me/libraryaddict/disguise/DisguiseAPI.java b/src/me/libraryaddict/disguise/DisguiseAPI.java index 92a3c0c2..870dcd67 100644 --- a/src/me/libraryaddict/disguise/DisguiseAPI.java +++ b/src/me/libraryaddict/disguise/DisguiseAPI.java @@ -178,7 +178,8 @@ public class DisguiseAPI { Method clear = entityTrackerEntry.getClass().getMethod("clear", ReflectionManager.getNmsClass("EntityPlayer")); Method updatePlayer = entityTrackerEntry.getClass().getMethod("updatePlayer", ReflectionManager.getNmsClass("EntityPlayer")); - for (Object player : trackedPlayers) { + HashSet cloned = (HashSet) trackedPlayers.clone(); + for (Object player : cloned) { if (entity instanceof Player && !((Player) getBukkitEntity.invoke(player)).canSee((Player) entity)) continue; clear.invoke(entityTrackerEntry, player);