diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-04-05 16:59:46 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-04-05 16:59:46 +0000 |
commit | 2442285d7bebe17fc963160f9a5886a1ee76790d (patch) | |
tree | 7438b9f69f38448bf1a9e9089300d9f17e9d639c /EssentialsChat | |
parent | 3ef2efd1fb0140a7f1cc87027cc25ca7b0c2a846 (diff) | |
download | Essentials-2442285d7bebe17fc963160f9a5886a1ee76790d.tar Essentials-2442285d7bebe17fc963160f9a5886a1ee76790d.tar.gz Essentials-2442285d7bebe17fc963160f9a5886a1ee76790d.tar.lz Essentials-2442285d7bebe17fc963160f9a5886a1ee76790d.tar.xz Essentials-2442285d7bebe17fc963160f9a5886a1ee76790d.zip |
[trunk] EssentialsChat: chat-radius is now multi world compatible.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1133 e251c2fe-e539-e718-e476-b85c1f46cddb
Diffstat (limited to 'EssentialsChat')
-rw-r--r-- | EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatWorker.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatWorker.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatWorker.java index 9cf9589cb..3c74fd8f0 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatWorker.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatWorker.java @@ -6,6 +6,7 @@ import com.nijikokun.bukkit.Permissions.Permissions; import java.util.logging.Logger; import org.bukkit.Location; import org.bukkit.Server; +import org.bukkit.World; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerChatEvent; import org.bukkit.event.player.PlayerEvent; @@ -95,6 +96,7 @@ public class EssentialsChatWorker logger.info("Local: <" + user.getName() + "> " + event.getMessage()); Location loc = user.getLocation(); + World w = loc.getWorld(); int x = loc.getBlockX(); int y = loc.getBlockY(); int z = loc.getBlockZ(); @@ -109,7 +111,7 @@ public class EssentialsChatWorker int dy = Math.abs(y - l.getBlockY()); int dz = Math.abs(z - l.getBlockZ()); int delta = dx + dy + dz; - if (delta > radius) continue; + if (delta > radius || w != l.getWorld()) continue; } u.sendMessage(String.format(event.getFormat(), user.getDisplayName(), event.getMessage())); |