Fixes an IllegalArgumentException (#640)

* Fixes an IllegalArgumentException

* Correct change and make it fit our format
This commit is contained in:
Josh 2016-10-31 02:06:42 -04:00 committed by Christopher Martin
parent 37b75ec14d
commit f5ead493a0

View file

@ -849,7 +849,7 @@ public class GeneralMethods {
Iterator<Entity> 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();