mirror of
https://github.com/Brettflan/WorldBorder.git
synced 2024-11-22 18:16:24 +01:00
should fix ConcurrentModificationException error
This commit is contained in:
parent
6b9a90a620
commit
40c3764049
@ -1,5 +1,6 @@
|
||||
package com.wimbli.WorldBorder;
|
||||
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
@ -11,7 +12,7 @@ import org.bukkit.World;
|
||||
|
||||
public class BorderCheckTask implements Runnable
|
||||
{
|
||||
Server server;
|
||||
Server server = null;
|
||||
|
||||
public BorderCheckTask(Server theServer)
|
||||
{
|
||||
@ -20,14 +21,22 @@ public class BorderCheckTask implements Runnable
|
||||
|
||||
public void run()
|
||||
{
|
||||
if (Config.movedPlayers.isEmpty())
|
||||
if (Config.movedPlayers.isEmpty() || server == null)
|
||||
return;
|
||||
|
||||
for (Iterator<String> p = Config.movedPlayers.iterator(); p.hasNext();)
|
||||
{
|
||||
String playerName = p.next();
|
||||
Player player = server.getPlayer(playerName);
|
||||
p.remove();
|
||||
Player player = null;
|
||||
try
|
||||
{
|
||||
String playerName = p.next();
|
||||
player = server.getPlayer(playerName);
|
||||
p.remove();
|
||||
}
|
||||
catch (ConcurrentModificationException ex)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (player == null || !player.isOnline()) continue;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: WorldBorder
|
||||
author: Brettflan
|
||||
description: Limit the size of your worlds with a border, round or square.
|
||||
version: 1.1
|
||||
version: 1.1.1
|
||||
main: com.wimbli.WorldBorder.WorldBorder
|
||||
commands:
|
||||
wborder:
|
||||
|
Loading…
Reference in New Issue
Block a user