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

Function getBlock

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

Source from the content-addressed store, hash-verified

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;
57 return blocks[blockIndex(x, y, z)];
58}
59
60function setBlock(x: number, y: number, z: number, type: number): void {
61 if (x < 0 || x >= worldSizeX || y < 0 || y >= WORLD_HEIGHT || z < 0 || z >= worldSizeZ) return;

Callers 4

generateTerrainFunction · 0.85
raycastBlockFunction · 0.85
handleInputFunction · 0.85
renderBlocksFunction · 0.85

Calls 1

blockIndexFunction · 0.85

Tested by

no test coverage detected