diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-03-30 12:56:34 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-03-30 12:56:34 +0000 |
commit | 08041599fffe85ef4e5da59cc060a690c7dc8994 (patch) | |
tree | 9c214b0328d346aaefb4d9f69cc10d3877fd44eb /EssentialsChat/src/com/earth2me/essentials/chat | |
parent | 81c9b91561fa978bcfa9f5824d5d60c949a622e5 (diff) | |
download | Essentials-08041599fffe85ef4e5da59cc060a690c7dc8994.tar Essentials-08041599fffe85ef4e5da59cc060a690c7dc8994.tar.gz Essentials-08041599fffe85ef4e5da59cc060a690c7dc8994.tar.lz Essentials-08041599fffe85ef4e5da59cc060a690c7dc8994.tar.xz Essentials-08041599fffe85ef4e5da59cc060a690c7dc8994.zip |
Revert to 1013
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1021 e251c2fe-e539-e718-e476-b85c1f46cddb
Diffstat (limited to 'EssentialsChat/src/com/earth2me/essentials/chat')
-rw-r--r-- | EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java | 7 | ||||
-rw-r--r-- | EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatWorker.java | 15 |
2 files changed, 10 insertions, 12 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java index e351cc865..890187ee3 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java @@ -2,7 +2,10 @@ package com.earth2me.essentials.chat; import com.earth2me.essentials.Essentials; import org.bukkit.Server; -import org.bukkit.event.player.*; +import org.bukkit.event.player.PlayerChatEvent; +import org.bukkit.event.player.PlayerEvent; +import org.bukkit.event.player.PlayerListener; +import org.bukkit.event.player.PlayerRespawnEvent; public class EssentialsChatPlayerListener extends PlayerListener @@ -16,7 +19,7 @@ public class EssentialsChatPlayerListener extends PlayerListener @Override @SuppressWarnings("CallToThreadDumpStack") - public void onPlayerJoin(PlayerJoinEvent event) + public void onPlayerJoin(PlayerEvent event) { try { diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatWorker.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatWorker.java index e11504259..09a27f18f 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatWorker.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatWorker.java @@ -52,20 +52,15 @@ public class EssentialsChatWorker public static void onPlayerChat(Server server, PlayerChatEvent event) { + if (event.isCancelled()) return; User user = User.get(event.getPlayer()); updateDisplayName(user); if (user.isAuthorized("essentials.chat.color")) event.setMessage(event.getMessage().replaceAll("&([0-9a-f])", "§$1")); - - event.setFormat(Essentials.getSettings().getChatFormat(user.getGroup()) - .replace('&', '§') - .replace("§§", "&") - .replace("{DISPLAYNAME}", "%1$s") - .replace("{GROUP}", user.getGroup()) - .replace("{MESSAGE}", "%2$s") - .replace("{WORLDNAME}", user.getWorld().getName())); - + + event.setFormat(Essentials.getSettings().getChatFormat(user.getGroup()).replace('&', '§').replace("§§", "&").replace("{DISPLAYNAME}", "%1$s").replace("{GROUP}", user.getGroup()).replace("{MESSAGE}", "%2$s").replace("{WORLDNAME}", user.getWorld().getName())); + int radius = Essentials.getSettings().getChatRadius(); if (radius < 1) return; @@ -81,7 +76,7 @@ public class EssentialsChatWorker event.setCancelled(true); return; } - + if (event.getMessage().startsWith("?") && event.getMessage().length() > 1) { if (user.isAuthorized("essentials.chat.question")) |