ChunkLocation
A ChunkLocation simply represents a specific chunk’s x and z coordinates.
public class ExampleClass { public boolean exampleUsage(@NotNull Block block) { // Get the chunk at 0, 0 ChunkLocation chunkLocation = ChunkLocation.of(0, 0); ChunkLocation chunkLocation2 = ChunkLocation.fromBlockCoords(block.getX(), block.getZ());
// Check if the second chunk location is within a 4 chunk radius of the first one return chunkLocation.isWithinRadius(chunkLocation2, 4); }}class ExampleClass { fun exampleUsage(block: Block): Boolean { // Get the chunk at 0, 0 val chunkLocation = ChunkLocation.of(0, 0) val chunkLocation2 = ChunkLocation.fromBlockCoords(block.x, block.z)
// Check if the second chunk location is within a 4 chunk radius of the first one return chunkLocation.isWithinRadius(chunkLocation2, 4) }}