Fixed a error which happened rarely

This commit is contained in:
libraryaddict 2013-11-23 04:39:35 +13:00
parent b93f5d3ea4
commit ce76bb47c5

View File

@ -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);