Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace ItemModel

Namespace used to change item models in player's hand and/or inventory. By default, if the block has an ICRender, it is automatically applied as item's model

Index

Properties

Readonly data

data: number

Item or block data current ItemModel relates to

Readonly id

id: number

Item or block id current ItemModel relates to

Functions

getAllModels

getEmptyMeshFromPool

getFor

  • getFor(id: number, data: number): ItemModel

getForWithFallback

  • getForWithFallback(id: number, data: number): ItemModel

getItemMeshTextureFor

  • getItemMeshTextureFor(id: number, data: number): string
  • Parameters

    • id: number

      item or block numeric id

    • data: number

      item or block data

    Returns string

    texture name for the specified item or block

getItemRenderMeshFor

  • getItemRenderMeshFor(id: number, count: number, data: number, randomize: boolean): RenderMesh

newStandalone

releaseMesh

tryReleaseModelBitmapsOnLowMemory

  • tryReleaseModelBitmapsOnLowMemory(bytes: number): void
  • Releases some of the bitmaps to free up memory

    Parameters

    • bytes: number

      bytes count to be released

    Returns void

Methods

addToMesh

  • addToMesh(mesh: RenderMesh, x: number, y: number, z: number): void

getCacheKey

  • getCacheKey(): string

getIconBitmap

  • getIconBitmap(): Bitmap

getIconBitmapNoReload

  • getIconBitmapNoReload(): Bitmap

getItemRenderMesh

  • getItemRenderMesh(cound: number, randomize: boolean): RenderMesh

getMeshTextureName

  • getMeshTextureName(): string

getModelForItemInstance

getShaderUniforms

getSpriteMesh

getUiGlintMaterialName

  • getUiGlintMaterialName(): string

getUiMaterialName

  • getUiMaterialName(): string

getUiTextureName

  • getUiTextureName(): string

getWorldGlintMaterialName

  • getWorldGlintMaterialName(): string

getWorldMaterialName

  • getWorldMaterialName(): string

getWorldTextureName

  • getWorldTextureName(): string

isEmpty

  • isEmpty(): boolean

isEmptyInUi

  • isEmptyInUi(): boolean

isEmptyInWorld

  • isEmptyInWorld(): boolean

isNonExistant

  • isNonExistant(): boolean

isSpriteInUi

  • isSpriteInUi(): boolean

isSpriteInWorld

  • isSpriteInWorld(): boolean

isUsingOverrideCallback

  • isUsingOverrideCallback(): boolean

newTexture

  • newTexture(): Bitmap

occupy

overridesHand

  • overridesHand(): boolean
  • Returns boolean

    true, if this item model overrides the default model in player's hand

overridesUi

  • overridesUi(): boolean
  • Returns boolean

    true, if this item model overrides the default model in player's inventory

queueReload

releaseIcon

  • releaseIcon(): void

reloadIcon

  • reloadIcon(): void

reloadIconIfDirty

  • reloadIconIfDirty(): void

removeModUiSpriteTexture

setCacheKey

  • setCacheKey(key: string): void

setGlintMaterial

  • setGlintMaterial(material: string): ItemModel

setHandGlintMaterial

  • setHandGlintMaterial(material: string): ItemModel

setHandMaterial

  • setHandMaterial(texture: string): ItemModel
  • Sets item model's material only in player's hand

    Parameters

    • texture: string

      material name to be used for the model

    Returns ItemModel

setHandModel

setHandTexture

  • Sets item model's texture only in player's hand

    Parameters

    • texture: string

      texture name to be used for the model (use "atlas::terrain" for block textures)

    Returns ItemModel

setItemTexture

  • setItemTexture(name: string, index: number): ItemModel

setItemTexturePath

  • setItemTexturePath(path: string): ItemModel

setMaterial

setModUiSpriteBitmap

  • setModUiSpriteBitmap(bitmap: Bitmap): ItemModel

setModUiSpriteName

  • setModUiSpriteName(name: string, index: number): ItemModel

setModUiSpritePath

  • setModUiSpritePath(path: string): ItemModel

setModel

setModelOverrideCallback

setSpriteUiRender

  • setSpriteUiRender(isSprite: boolean): ItemModel

setTexture

  • Sets item model's texture in both player's invantory and in hand

    Parameters

    • texture: string

      texture name to be used for the model (use "atlas::terrain" for block textures)

    Returns ItemModel

setUiGlintMaterial

  • setUiGlintMaterial(material: string): ItemModel

setUiMaterial

  • Sets item model's material only in player's inventory

    Parameters

    • texture: string

      material name to be used for the model

    Returns ItemModel

setUiModel

setUiTexture

  • Sets item model's texture only in player's inventory

    Parameters

    • texture: string

      texture name to be used for the model (use "atlas::terrain" for block textures)

    Returns ItemModel

Generated using TypeDoc