[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
This commit is contained in:
snowleo 2011-04-05 16:59:46 +00:00
parent 3ef2efd1fb
commit 2442285d7b
1 changed files with 3 additions and 1 deletions

View File

@ -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()));