// -->
if (attribute.startsWith("list_chunks")) {
Set<Chunk> chunks = new HashSet<Chunk>();
for (LocationPair pair : pairs) {
int minY = pair.low.getBlockY();
Chunk minChunk = pair.low.getChunk();
if (isInsideCuboid(new Location(getWorld(), minChunk.getX()*16, minY, minChunk.getZ()*16)))
chunks.add(minChunk);
Chunk maxChunk = pair.high.getChunk();
if (isInsideCuboid(new Location(getWorld(), maxChunk.getX()*16+15, minY, maxChunk.getZ()*16+15)))
chunks.add(maxChunk);
dB.log("min:" + minChunk.getX() + "," + minChunk.getZ());
dB.log("max:" + maxChunk.getX() + "," + maxChunk.getZ());
for(int x = minChunk.getX()+1; x <= maxChunk.getX()-1; x++) {
for(int z = minChunk.getZ()+1; z <= maxChunk.getZ()-1; z++) {
chunks.add(getWorld().getChunkAt(x, z));
}
}
}
dList list = new dList();
for (Chunk chunk : chunks)
list.add(new dChunk(chunk).identify());
return list.getAttribute(attribute.fulfill(1));
}
// <--[tag]
// @attribute <cu@cuboid.list_partial_chunks>
// @returns dList(dChunk)
// @description
// Gets a list of all chunks partially or entirely within the dCuboid.
// -->
if (attribute.startsWith("list_partial_chunks")) {
Set<Chunk> chunks = new HashSet<Chunk>();
for (LocationPair pair : pairs) {
Chunk minChunk = pair.low.getChunk();
Chunk maxChunk = pair.high.getChunk();
dB.log("min:" + minChunk.getX() + "," + minChunk.getZ());
dB.log("max:" + maxChunk.getX() + "," + maxChunk.getZ());
for (int x = minChunk.getX(); x <= maxChunk.getX(); x++) {
for (int z = minChunk.getZ(); z <= maxChunk.getZ(); z++) {
chunks.add(getWorld().getChunkAt(x, z));
}
}
}
dList list = new dList();