noa.registry - Where you register your voxel types, materials, properties, and events.

This module uses the following default options (from the options object passed to the Engine):

var defaults = {
texturePath: ''
}

Hierarchy

  • Registry

Properties

getBlockFaceMaterial: ((blockId, dir) => number)

Type declaration

    • (blockId, dir): number
    • Parameters

      • blockId: any
      • dir: any

      Returns number

getBlockFluidity: ((id) => boolean)

Type declaration

    • (id): boolean
    • block is fluid or not

      Parameters

      • id: any

      Returns boolean

getBlockOpacity: ((id) => boolean)

Type declaration

    • (id): boolean
    • block opacity - whether it obscures the whole voxel (dirt) or can be partially seen through (like a fencepost, etc)

      Parameters

      • id: any

      Returns boolean

getBlockProps: ((id) => any)

Type declaration

    • (id): any
    • Get block property object passed in at registration

      Parameters

      • id: any

      Returns any

getBlockSolidity: ((id) => boolean)

Type declaration

    • (id): boolean
    • block solidity (as in physics)

      Parameters

      • id: any

      Returns boolean

getMaterialData: ((matID) => MatDef)

Type declaration

    • (matID): MatDef
    • General lookup for all properties of a block material

      Parameters

      • matID: number

      Returns MatDef

registerBlock: ((id?, options?) => number)

Type declaration

    • (id?, options?): number
    • Register (by integer ID) a block type and its parameters. id param: integer, currently 1..65535. Generally you should specify sequential values for blocks, without gaps, but this isn't technically necessary.

      Parameters

      • id: number = 1

        sequential integer ID (from 1)

      • Optional options: Partial<BlockOptions> = null

      Returns number

      the id value specified

registerMaterial: ((name?, options?) => number)

Type declaration

    • (name?, options?): number
    • Register (by name) a material and its parameters.

      Parameters

      • name: string = '?'

        of this material

      • Optional options: Partial<MaterialOptions> = null

      Returns number

Generated using TypeDoc