Skip to content

Commit

Permalink
fix dLocation.find.blocks.within
Browse files Browse the repository at this point in the history
wooops
  • Loading branch information
mcmonkey4eva committed Nov 23, 2014
1 parent da53ce3 commit a45480d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main/java/net/aufdemrand/denizen/objects/dLocation.java
Expand Up @@ -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) {
Expand All @@ -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<dLocation>() {
@Override
Expand Down

0 comments on commit a45480d

Please sign in to comment.