MCPcopy Create free account
hub / github.com/VolmitSoftware/Adapt / getChunks

Method getChunks

src/main/java/com/volmit/adapt/util/Cuboid.java:628–642  ·  view source on GitHub ↗

Get a list of the chunks which are fully or partially contained in this cuboid. @return a list of Chunk objects

()

Source from the content-addressed store, hash-verified

626 * @return a list of Chunk objects
627 */
628 public List<Chunk> getChunks() {
629 List<Chunk> res = new ArrayList<Chunk>();
630
631 World w = getWorld();
632 int x1 = getLowerX() & ~0xf;
633 int x2 = getUpperX() & ~0xf;
634 int z1 = getLowerZ() & ~0xf;
635 int z2 = getUpperZ() & ~0xf;
636 for (int x = x1; x <= x2; x += 16) {
637 for (int z = z1; z <= z2; z += 16) {
638 res.add(w.getChunkAt(x >> 4, z >> 4));
639 }
640 }
641 return res;
642 }
643
644 /**
645 * Set all the blocks within the Cuboid to the given MaterialData, using a

Callers 1

getEntitiesMethod · 0.95

Calls 6

getWorldMethod · 0.95
getLowerXMethod · 0.95
getUpperXMethod · 0.95
getLowerZMethod · 0.95
getUpperZMethod · 0.95
addMethod · 0.65

Tested by

no test coverage detected