you can't read an array and modify it at the same time

This commit is contained in:
ZeroEpoch1969 2020-01-09 21:50:45 -07:00
parent f989b34ada
commit 98ed23969a
No known key found for this signature in database
GPG Key ID: A7BAB4E14F089CF3

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod.command; package me.totalfreedom.totalfreedommod.command;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -20,12 +21,15 @@ public class Command_playerverify extends FreedomCommand
{ {
VPlayer target = plugin.pv.getVerificationPlayer(playerSender); VPlayer target = plugin.pv.getVerificationPlayer(playerSender);
List<String> ips = new ArrayList<>();
ips.addAll(target.getIps());
if (args.length == 1) if (args.length == 1)
{ {
if (args[0].equalsIgnoreCase("clearips")) if (args[0].equalsIgnoreCase("clearips"))
{ {
int cleared = 0; int cleared = 0;
for (String ip : target.getIps()) for (String ip : ips)
{ {
if (!ip.equals(Ips.getIp(playerSender))) if (!ip.equals(Ips.getIp(playerSender)))
{ {