Taos API Reference
    Preparing search index...

    Module block

    The voxel world: block and chunk types, the meshing/atlas pipeline, biomes, and procedural world generation. The infinite chunked world the engine streams and renders.

    Enumerations

    BiomeType

    Discrete biome categories used by world generation.

    EnvironmentEffect

    Ambient weather/particle effect associated with a biome.

    BlockType

    Identifier for every distinct block kind. NONE is air, MAX is a sentinel.

    Classes

    BlockEntityStore

    Side-table of per-block state keyed by world position.

    ScheduledTickQueue

    Binary min-heap of scheduled block ticks, ordered by due time then insertion order (stable FIFO among same-tick entries). At most one pending tick per position — re-scheduling an already-pending block is a no-op, the way fluids and redstone want it.

    BlockTextureOffsetData

    Per-block atlas tile coordinates for each face group, plus an optional uniform sRGB tint multiplied into the sampled albedo at render time.

    BlockMaterialData

    Material/physics flags for a block.

    BlockLightData

    Point-light parameters emitted by a block.

    Chunk

    A 16x16x16 cube of blocks with axis convention X = width, Y = height (vertical), Z = depth.

    BlockWorld

    Streaming voxel world built from Chunks keyed by integer chunk coordinates.

    Interfaces

    BlockEntity

    Per-block state record. type is the owning block id; other fields are block-specific.

    ChunkMesh

    Vertex buffers and counts produced by Chunk.generateVertices.

    GenCtx

    Read-only world queries available to a structure's planner (deterministic, from noise).

    Builder

    Block writer scoped to the chunk being generated; out-of-chunk writes are dropped.

    StructurePiece

    A world-space axis-aligned region plus a closure that builds it.

    StructurePlan

    A planned structure: the set of pieces to build.

    StructureDef

    A registered structure type.

    ChunkBox

    Inclusive world-space box of the chunk currently being generated.

    RaycastResult

    Result of a successful voxel raycast.

    Type Aliases

    TickHandler

    Invoked for a block at world (x,y,z); blockId is the block that scheduled/owns the tick.

    NeighborHandler

    Invoked for the block at (x,y,z) when an adjacent block (at fx,fy,fz) changed. Used by blocks that depend on their surroundings — plants needing support, redstone, observers, fluids re-flowing into a new opening.

    Variables

    BASE_RESOLUTION_WIDTH

    Reference horizontal resolution used for UI layout scaling.

    BASE_RESOLUTION_HEIGHT

    Reference vertical resolution used for UI layout scaling.

    BLOCK_ATLAS_WIDTH

    Width in pixels of the block texture atlas. Sourced from blocks.json.

    BLOCK_ATLAS_HEIGHT

    Height in pixels of the block texture atlas. Sourced from blocks.json.

    BLOCK_ATLAS_TEX_SIZE

    Width and height in pixels of a single block texture tile in the atlas.

    BLOCK_ATLAS_WIDTH_DIVIDED

    Number of tile columns in the atlas.

    BLOCK_ATLAS_HEIGHT_DIVIDED

    Number of tile rows in the atlas.

    BLOCK_TYPE_COUNT

    Number of distinct BlockType values, excluding the MAX sentinel.

    blockTextureOffsetData
    blockMaterialData
    blockLightData
    blockTypeName
    blockPlaceable

    Whether the block appears in the inventory block picker. Indexed by BlockType.

    Functions

    getBiomeEnvironmentEffect

    Returns the weather/particle effect that should play in the given biome.

    getBiomeCloudBounds

    Returns the vertical cloud layer bounds (in world units) for the biome.

    getBiomeCloudCoverage

    Returns the cloud coverage density multiplier for the biome.

    registerDefaultBlockBehaviors

    Registers the engine's default block tick behaviors (idempotent).

    registerScheduledTick

    Registers a handler run when a scheduled tick for blockId comes due.

    registerRandomTick

    Registers a handler run when blockId is hit by a random tick.

    registerNeighborHandler

    Registers a handler run when a block adjacent to blockId changes.

    getScheduledTick
    getRandomTick
    getNeighborHandler
    hasRandomTickHandlers

    True if any random-tick handler is registered (lets the world skip the random-tick sweep).

    hasNeighborHandlers

    True if any neighbor handler is registered (lets the world skip neighbor notifications).

    clearTickHandlers

    Clears all tick handlers (tests / re-init).

    isBlockWater

    Returns true if the block is water.

    isBlockOpaque

    Returns true if the block is fully opaque.

    isBlockSemiTransparent

    Returns true if the block is semi-transparent or a prop (rendered in the alpha pass).

    isBlockCollidable

    Returns true if the block collides with entities.

    isBlockEmittingLight

    Returns true if the block emits light.

    isBlockProp

    Returns true if the block is a prop (billboard, non-collidable foliage, etc.).

    isBlockPlaceable

    Returns true if the block should appear in the inventory block picker.

    getBlockName

    Returns the display name for the block.

    getBlockTypeAABB

    Writes the block's local-space AABB into dest[0] (min) and dest[1] (max).

    getBlockLightingData

    Returns the light parameters for the block, or the first entry as a fallback.

    generateBlockInfoUniformBuffer

    Builds and uploads the per-block-type uniform buffer used by chunk shaders.

    registerFluids

    Registers water & lava flow on the block-ticking core (idempotent).

    placeFluid

    Places a fluid block and schedules it to start flowing — for buckets, fluid sources, and tests. block is a source (WATER / LAVA_STILL) or flow id.

    stampTemplate

    Stamps an ASCII template via a set callback (shared by the engine's chunk builder and tools/samples so the two can't diverge). layers[dy][dz] is a row of chars along +X; palette maps chars to blocks (unmapped/space = skip); rot (0–3) rotates the footprint 90° clockwise about the origin.

    registerStructure

    Registers a structure type (idempotent by id).

    clearStructures

    Removes all registered structures (tests / re-init).

    structureCount

    Number of registered structure types.

    buildStructuresForChunk

    Builds every registered structure whose volume overlaps the given chunk into builder. Sweeps the chunk's region cell plus its 8 neighbors, so structures rooted in adjacent regions carry their overlapping pieces in.