clanchatplugin: fix issue 1407, UnsupportedOperationException (#1411)
* clanchatplugin: fix issue 1407, UnsupportedOperationException * Fixed concurrentmodification exception
This commit is contained in:
@@ -259,14 +259,13 @@ public class ClanChatPlugin extends Plugin
|
||||
if (member.getWorld() == client.getWorld())
|
||||
{
|
||||
final String memberName = Text.toJagexName(member.getUsername());
|
||||
final Iterator<Player> each = clanMembers.iterator();
|
||||
|
||||
while (each.hasNext())
|
||||
List<Player> toRemove = new ArrayList<>();
|
||||
for (Player each : clanMembers)
|
||||
{
|
||||
if (memberName.equals(Text.toJagexName(each.next().getName())))
|
||||
if (memberName.equals(Text.toJagexName(each.getName())))
|
||||
{
|
||||
each.remove();
|
||||
|
||||
toRemove.add(each);
|
||||
if (clanMembers.isEmpty())
|
||||
{
|
||||
removeClanCounter();
|
||||
@@ -275,6 +274,7 @@ public class ClanChatPlugin extends Plugin
|
||||
break;
|
||||
}
|
||||
}
|
||||
clanMembers.removeAll(toRemove);
|
||||
}
|
||||
|
||||
if (!this.showJoinLeave ||
|
||||
|
||||
Reference in New Issue
Block a user