// Create a list block volume with specific block locations constlocations: Vector3[] = [ { x:0, y:64, z:0 }, { x:1, y:64, z:0 }, { x:2, y:64, z:0 }, { x:0, y:65, z:0 }, { x:5, y:70, z:10 }, ];
// Create a ListBlockVolume from an array of locations constlistVolume = newListBlockVolume(locations);
// Get the bounding box that encompasses all locations constboundingBox = listVolume.getBoundingBox(); console.log( `Bounding box from (${boundingBox.min.x}, ${boundingBox.min.y}, ${boundingBox.min.z}) to (${boundingBox.max.x}, ${boundingBox.max.y}, ${boundingBox.max.z})` );
// Iterate through all block locations in the volume constiterator = listVolume.getBlockLocationIterator(); letcount = 0; for (constlocationofiterator) { count++; console.log(`Block ${count}: (${location.x}, ${location.y}, ${location.z})`); }
// Example: Create a list volume for a specific pattern (like a plus sign) constplusPattern: Vector3[] = [ { x:0, y:64, z:0 }, // center { x:1, y:64, z:0 }, // east { x: -1, y:64, z:0 }, // west { x:0, y:64, z:1 }, // north { x:0, y:64, z: -1 }, // south ];
Example: createListBlockVolume.ts