summaryrefslogtreecommitdiffstats
path: root/EssentialsChat/src
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2012-01-02 22:38:47 +0100
committersnowleo <schneeleo@gmail.com>2012-01-02 22:38:47 +0100
commit41e0e64a5f83cb036e90d3c299f65b69caa9dd63 (patch)
tree13afb78219a5faadbc22c179a9d062899097d393 /EssentialsChat/src
parenta20e96af4e31deb60e85454698945df05fc7e817 (diff)
downloadEssentials-41e0e64a5f83cb036e90d3c299f65b69caa9dd63.tar
Essentials-41e0e64a5f83cb036e90d3c299f65b69caa9dd63.tar.gz
Essentials-41e0e64a5f83cb036e90d3c299f65b69caa9dd63.tar.lz
Essentials-41e0e64a5f83cb036e90d3c299f65b69caa9dd63.tar.xz
Essentials-41e0e64a5f83cb036e90d3c299f65b69caa9dd63.zip
EssentialsSpawn and EssentialsChat should build now again
Diffstat (limited to 'EssentialsChat/src')
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
index 17cc7c2f3..d42d341a0 100644
--- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
@@ -4,7 +4,9 @@ import com.earth2me.essentials.ChargeException;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.api.IEssentials;
import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.api.ISettings;
import com.earth2me.essentials.api.IUser;
+import com.earth2me.essentials.settings.GroupOptions;
import java.util.Locale;
import java.util.Map;
import java.util.logging.Logger;
@@ -111,8 +113,9 @@ public abstract class EssentialsChatPlayer extends PlayerListener
if (user.isAuthorized("essentials.chat.color"))
{
event.setMessage(event.getMessage().replaceAll("&([0-9a-f])", "\u00a7$1"));
- }
- event.setFormat(ess.getSettings().getChatFormat(user.getGroup()).replace('&', '\u00a7').replace("\u00a7\u00a7", "&").replace("{DISPLAYNAME}", "%1$s").replace("{GROUP}", user.getGroup()).replace("{MESSAGE}", "%2$s").replace("{WORLDNAME}", user.getWorld().getName()).replace("{SHORTWORLDNAME}", user.getWorld().getName().substring(0, 1).toUpperCase(Locale.ENGLISH)));
+ }
+ String format = ess.getGroups().getChatFormat(user);
+ event.setFormat(format.replace('&', '\u00a7').replace("\u00a7\u00a7", "&").replace("{DISPLAYNAME}", "%1$s").replace("{GROUP}", user.getGroup()).replace("{MESSAGE}", "%2$s").replace("{WORLDNAME}", user.getWorld().getName()).replace("{SHORTWORLDNAME}", user.getWorld().getName().substring(0, 1).toUpperCase(Locale.ENGLISH)));
}
protected String getChatType(final String message)
@@ -132,8 +135,14 @@ public abstract class EssentialsChatPlayer extends PlayerListener
protected void handleLocalChat(final Map<PlayerChatEvent, String> charges, final PlayerChatEvent event)
{
-
- long radius = ess.getSettings().getChatRadius();
+ long radius = 0;
+ ISettings settings = ess.getSettings();
+ settings.acquireReadLock();
+ try {
+ radius = settings.getData().getChat().getLocalRadius();
+ } finally {
+ settings.unlock();
+ }
radius *= radius;
final IUser user = ess.getUser(event.getPlayer());