diff options
author | Wesley Wolfe <weswolf@aol.com> | 2012-06-12 10:59:29 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-06-12 16:37:47 -0400 |
commit | 478654351a0c16d62bb849fb87094dc692e96466 (patch) | |
tree | fc82e68bd7fbf01d9e6ef2f474ec0f2aa61ea347 /src/main/java | |
parent | b7827c4d224b695e2e5735fb2161bcd607c291c1 (diff) | |
download | craftbukkit-478654351a0c16d62bb849fb87094dc692e96466.tar craftbukkit-478654351a0c16d62bb849fb87094dc692e96466.tar.gz craftbukkit-478654351a0c16d62bb849fb87094dc692e96466.tar.lz craftbukkit-478654351a0c16d62bb849fb87094dc692e96466.tar.xz craftbukkit-478654351a0c16d62bb849fb87094dc692e96466.zip |
Check world before checking distance. Fixes BUKKIT-1792
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 0ad2920f..2c41db32 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -763,6 +763,9 @@ public class CraftWorld implements World { } public void playEffect(Location location, Effect effect, int data, int radius) { + Validate.notNull(location, "Location cannot be null"); + Validate.notNull(effect, "Effect cannot be null"); + Validate.notNull(location.getWorld(), "World cannot be null"); int packetData = effect.getId(); Packet61WorldEvent packet = new Packet61WorldEvent(packetData, location.getBlockX(), location.getBlockY(), location.getBlockZ(), data); int distance; @@ -770,6 +773,7 @@ public class CraftWorld implements World { for (Player player : getPlayers()) { if (((CraftPlayer) player).getHandle().netServerHandler == null) continue; + if (!location.getWorld().equals(player.getWorld())) continue; distance = (int) player.getLocation().distanceSquared(location); if (distance <= radius) { |