From f5ead493a075edf961909a5f55a6d662a4f4df3b Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 31 Oct 2016 02:06:42 -0400 Subject: [PATCH] Fixes an IllegalArgumentException (#640) * Fixes an IllegalArgumentException * Correct change and make it fit our format --- src/com/projectkorra/projectkorra/GeneralMethods.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/projectkorra/projectkorra/GeneralMethods.java b/src/com/projectkorra/projectkorra/GeneralMethods.java index 556e2ad4..b3be7d62 100644 --- a/src/com/projectkorra/projectkorra/GeneralMethods.java +++ b/src/com/projectkorra/projectkorra/GeneralMethods.java @@ -849,7 +849,7 @@ public class GeneralMethods { Iterator entityIterator = entities.iterator(); while (entityIterator.hasNext()) { Entity e = entityIterator.next(); - if (e.getLocation().distanceSquared(location) > radius * radius) { + if (e.getWorld().equals(location.getWorld()) && e.getLocation().distanceSquared(location) > radius * radius) { entityIterator.remove(); } else if (e instanceof Player && ((Player)e).getGameMode().equals(GameMode.SPECTATOR)) { entityIterator.remove(); @@ -1936,4 +1936,4 @@ public class GeneralMethods { e.printStackTrace(); } } -} \ No newline at end of file +}