Make chat handling more thread safe (and also faster)

This commit is contained in:
snowleo 2012-08-03 22:57:29 +02:00
parent 52702894af
commit 1a07815f4b
4 changed files with 132 additions and 45 deletions

View file

@ -440,14 +440,14 @@ public abstract class UserData extends PlayerExtension implements IConf
public List<String> getIgnoredPlayers()
{
return config.getStringList("ignore");
return Collections.synchronizedList(config.getStringList("ignore"));
}
public void setIgnoredPlayers(List<String> players)
{
if (players == null || players.isEmpty())
{
ignoredPlayers = new ArrayList<String>();
ignoredPlayers = Collections.synchronizedList(new ArrayList<String>());
config.removeProperty("ignore");
}
else
@ -466,7 +466,7 @@ public abstract class UserData extends PlayerExtension implements IConf
{
return false;
}
return isIgnoredPlayer(user);
return isIgnoredPlayer(user);
}
public boolean isIgnoredPlayer(IUser user)