BlockRenderer
Index
Classes
Interfaces
Type Aliases
Functions
- addRenderCallback
- createModel
- createTexturedBlock
- createTexturedBox
- disableCustomRender
- enableCoordMapping
- enableCustomRender
- forceRenderRebuild
- mapAtCoords
- mapCollisionAndRaycastModelAtCoords
- mapCollisionModelAtCoords
- mapRaycastModelAtCoords
- setCustomCollisionAndRaycastShape
- setCustomCollisionShape
- setCustomRaycastShape
- setStaticICRender
- unmapAtCoords
- unmapCollisionAndRaycastModelAtCoords
- unmapCollisionModelAtCoords
- unmapRaycastModelAtCoords
Classes
Model
Class representing model used by BlockRenderer.
constructor
Creates a new empty model.
Returns Model
addBox
Adds new box to the model using specified block's textures.
Parameters
x1: number
y1: number
z1: number
x2: number
y2: number
z2: number
id: number
data: number
Returns void
addMesh
Adds new RenderMesh to the model.
Parameters
mesh: RenderMesh
Returns void
Interfaces
RenderAPI
Object used to manipulate rendered block during Callback.CustomBlockTessellationFunction calls.
getAddr
Returns number
Pointer to native object instance of the following object, to be used in custom native code, etc.
renderBlock
Renders full block at specified coordinates.
Parameters
x: number
y: number
z: number
blockId: number
ID of the block to be used as texture source
blockData: number
data of the block to be used as texture source
Returns void
renderBlockHere
Renders full block at current block coordinates.
Parameters
blockId: number
ID of the block to be used as texture source
blockData: number
data of the block to be used as texture source
Returns void
renderBoxId
Renders box at the specified coordinates of the specified size.
Parameters
x: number
y: number
z: number
x1: number
y1: number
z1: number
x2: number
y2: number
z2: number
id: number
ID of the block to be used as texture source
data: number
data of the block to be used as texture source
Returns void
renderBoxIdHere
Renders box at current block coordinates of the specified size.
Parameters
x1: number
y1: number
z1: number
x2: number
y2: number
z2: number
id: number
ID of the block to be used as texture source
data: number
data of the block to be used as texture source
Returns void
renderBoxTexture
Renders box at the specified coordinates of the specified size.
Parameters
x: number
y: number
z: number
x1: number
y1: number
z1: number
x2: number
y2: number
z2: number
texName: string
block texture name
texId: number
block texture ID
Returns void
renderBoxTextureHere
Renders box at current block coordinates of the specified size.
Parameters
x1: number
y1: number
z1: number
x2: number
y2: number
z2: number
id: number
ID of the block to be used as texture source
data: number
data of the block to be used as texture source
Returns void
renderModel
Renders block model at the specified coordinates.
Parameters
x: number
y: number
z: number
model: Model
block model to be rendered at the specified coordinates
Returns void
renderModelHere
Renders block model at current block coordinates.
Parameters
model: Model
block model to be rendered at current block coordinates
Returns void
Type Aliases
ModelTextureSet
Type used to describe a new model for BlockRenderer.
Functions
addRenderCallback
Adds "CustomBlockTessellation" callback function for specified block ID.
Parameters
id: number
block ID
callback: CustomBlockTessellationFunction
function to be called when the event occurs
Returns void
createModel
Creates a new empty block model.
Returns BlockRenderer.Model
Empty block model.
createTexturedBlock
Constructs new block model of specified simple block of the normal block size shape with specified textures.
Parameters
descr: ModelTextureSet
texture set used for the box
Returns BlockRenderer.Model
createTexturedBox
Constructs new block model of specified simple block shape with specified textures.
Parameters
x1: number
y1: number
z1: number
x2: number
y2: number
z2: number
descr: ModelTextureSet
texture set used for the box
Returns BlockRenderer.Model
disableCustomRender
Disables custom rendering for the specified block.
Parameters
id: number
block ID
data: number
block data or -1 to map all the data values
Returns void
enableCoordMapping
Enables block mapping for the specified block.
Parameters
id: number
block ID
data: number
block data or -1 to map all the data values
icRender: Model
default model for the block
Returns void
enableCustomRender
Enables custom rendering for the specified block.
Parameters
id: number
block ID
data: number
block data or -1 to map all the data values
Returns void
forceRenderRebuild
Forces block renders to be rebuilt immediately.
Parameters
x: number
y: number
z: number
mode: number
if 0 is passed, only the specified block gets rebuilt, if 1 is passed, all the blocks along y axes are rebuilt
Returns void
mapAtCoords
Changes shape of the block on the specified coordinates.
Parameters
x: number
y: number
z: number
icRender: Model
ICRender.Model object to be displayed at the coordinates
optionalpreventRebuild: boolean
if false or not specified, rebuild is performed immediately
Returns void
mapCollisionAndRaycastModelAtCoords
Changes both collision and raycast shape of the block on given coords in given dimension.
Parameters
dimension: number
x: number
y: number
z: number
shape: CollisionShape
ICRender.CollisionShape object to be used as new collision and raycast shape
Returns void
mapCollisionModelAtCoords
Changes collision shape of the block on given coords in given dimension.
Parameters
dimension: number
x: number
y: number
z: number
shape: CollisionShape
ICRender.CollisionShape object to be used as new collision shape
Returns void
mapRaycastModelAtCoords
Changes raycast shape of the block on given coords in given dimension.
Parameters
dimension: number
x: number
y: number
z: number
shape: CollisionShape
ICRender.CollisionShape object to be used as new raycast shape
Returns void
setCustomCollisionAndRaycastShape
Specifies custom collision and raycast shape for the block.
Parameters
id: number
block ID
data: number
block data or -1 to map all the data values
shape: CollisionShape
ICRender.CollisionShape object to be used as default collision and raycast shape for the specified block
Returns void
setCustomCollisionShape
Specifies custom collision shape for the block.
Parameters
id: number
block ID
data: number
block data
shape: CollisionShape
ICRender.CollisionShape object to be used as default collision shape for the specified block
Returns void
setCustomRaycastShape
Specifies custom raycast shape for the block.
Parameters
id: number
block ID
data: number
block data or -1 to map all the data values
shape: CollisionShape
ICRender.CollisionShape object to be used as default raycast shape for the specified block
Returns void
setStaticICRender
Sets static ICRender model as block render shape.
Parameters
id: number
block ID
data: number
block data or -1 to map all the data values
icRender: Model
ICRender.Model object to be used as static block shape
Returns void
unmapAtCoords
Resets shape of the block to default on the specified coordinates.
Parameters
x: number
y: number
z: number
optionalpreventRebuild: boolean
if false or not specified, rebuild is performed immediately
Returns void
unmapCollisionAndRaycastModelAtCoords
Resets both collision and raycast shape of the block to default on given coords in given dimension.
Parameters
dimension: number
x: number
y: number
z: number
Returns void
unmapCollisionModelAtCoords
Resets collision shape of the block to default on given coords in given dimension.
Parameters
dimension: number
x: number
y: number
z: number
Returns void
unmapRaycastModelAtCoords
Resets raycast shape of the block to default on given coords in given dimension.
Parameters
dimension: number
x: number
y: number
z: number
Returns void
Module used to create blocks with any custom model.