Get a list of the chunks which are fully or partially contained in this cuboid. @return a list of Chunk objects
()
| 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 |