MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / blockIndex

Function blockIndex

examples/voxel-sandbox/main.ts:51–53  ·  view source on GitHub ↗
(x: number, y: number, z: number)

Source from the content-addressed store, hash-verified

49}
50
51function blockIndex(x: number, y: number, z: number): number {
52 return (y * worldSizeX * worldSizeZ) + (z * worldSizeX) + x;
53}
54
55function getBlock(x: number, y: number, z: number): number {
56 if (x < 0 || x >= worldSizeX || y < 0 || y >= WORLD_HEIGHT || z < 0 || z >= worldSizeZ) return BLOCK_AIR;

Callers 2

getBlockFunction · 0.85
setBlockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected