diff --git a/src/main/java/net/aufdemrand/denizen/objects/dLocation.java b/src/main/java/net/aufdemrand/denizen/objects/dLocation.java index 178206eb9a..91cd016f1e 100644 --- a/src/main/java/net/aufdemrand/denizen/objects/dLocation.java +++ b/src/main/java/net/aufdemrand/denizen/objects/dLocation.java @@ -726,14 +726,13 @@ else if (yaw < 315) Location loc = getBlock().getLocation().add(0.5f, 0.5f, 0.5f); fullloop: - for (double x = -(radius); x <= radius; x++) - for (double y = -(radius); y <= radius; y++) + for (double x = -(radius); x <= radius; x++) { + for (double y = -(radius); y <= radius; y++) { for (double z = -(radius); z <= radius; z++) { index++; if (index > max) break fullloop; - if (index > max) - if (Utilities.checkLocation(loc, getBlock().getLocation().add(x, y, z), radius)) + if (Utilities.checkLocation(loc, getBlock().getLocation().add(x, y, z), radius)) { if (!materials.isEmpty()) { for (dMaterial material : materials) { if (material.hasData() && material.getData() != 0) { @@ -744,8 +743,13 @@ else if (yaw < 315) } else if (material.getMaterial() == getBlock().getLocation().add(x, y, z).getBlock().getType()) found.add(new dLocation(getBlock().getLocation().add(x + 0.5, y, z + 0.5))); } - } else found.add(new dLocation(getBlock().getLocation().add(x + 0.5, y, z + 0.5))); + } else { + found.add(new dLocation(getBlock().getLocation().add(x + 0.5, y, z + 0.5))); + } + } } + } + } Collections.sort(found, new Comparator() { @Override