Return List instead of CopyOnWriteArrayList

This commit is contained in:
Daniel Saukel 2016-06-28 23:35:25 +02:00
parent 5aca93ef88
commit 2efa8e0527

View File

@ -40,7 +40,8 @@ import io.github.dre2n.dungeonsxl.trigger.DistanceTrigger;
import io.github.dre2n.dungeonsxl.world.DGameWorld; import io.github.dre2n.dungeonsxl.world.DGameWorld;
import io.github.dre2n.dungeonsxl.world.DResourceWorld; import io.github.dre2n.dungeonsxl.world.DResourceWorld;
import java.io.File; import java.io.File;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Location; import org.bukkit.Location;
@ -928,8 +929,8 @@ public class DGamePlayer extends DInstancePlayer {
return null; return null;
} }
public static CopyOnWriteArrayList<DGamePlayer> getByWorld(World world) { public static List<DGamePlayer> getByWorld(World world) {
CopyOnWriteArrayList<DGamePlayer> dPlayers = new CopyOnWriteArrayList<>(); List<DGamePlayer> dPlayers = new ArrayList<>();
for (DGamePlayer dPlayer : plugin.getDPlayers().getDGamePlayers()) { for (DGamePlayer dPlayer : plugin.getDPlayers().getDGamePlayers()) {
if (dPlayer.getWorld() == world) { if (dPlayer.getWorld() == world) {