Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BlockState

Class to work with vanilla blocks parameters

Hierarchy

  • BlockState

Implements

Index

Constructors

constructor

  • new BlockState(id: number, data: number): BlockState
  • new BlockState(id: number, scriptable: { key: number }): BlockState
  • Constructs new BlockState object from given id and data

    Parameters

    • id: number
    • data: number

    Returns BlockState

  • Constructs new BlockState object from given id and states object

    Parameters

    • id: number
    • scriptable: { key: number }
      • key: number

    Returns BlockState

Properties

Readonly data

data: number

Data of the block

Readonly id

id: number

Numeric ID of the block

Methods

addState

  • addState(state: number, value: number): BlockState

addStates

  • Adds states to the following object from given java.util.Map instance

    Parameters

    • states: Map<unknown, number>

    Returns BlockState

    BlockState object itself

  • Adds states to the following object from given JS object instance

    Parameters

    • states: object

    Returns BlockState

    BlockState object itself

equals

  • equals(object: any): boolean
  • Parameters

    • object: any

    Returns boolean

    whether the following object is equal to given, according to different parameters

getData

  • getData(): number

getId

  • getId(): number

getNamedStates

  • getNamedStates(): Map<string, number>
  • Returns Map<string, number>

    all NAMED states from following object in java.util.Map instance

getNamedStatesScriptable

  • getNamedStatesScriptable(): {}
  • Returns {}

    all NAMED states from following object in JS object instance

    • [key: string]: number

getRuntimeId

  • getRuntimeId(): number

getState

  • getState(state: number): number
  • Parameters

    • state: number

    Returns number

    state of the given number if it's present in the following object

getStates

  • getStates(): Map<number, number>
  • Returns Map<number, number>

    all states from following object in java.util.Map instance

getStatesScriptable

  • getStatesScriptable(): {}
  • Returns {}

    all states from following object in JS object instance

    • [key: string]: number

hasState

  • hasState(state: number): boolean
  • Parameters

    • state: number

    Returns boolean

    whether the state by given number is present in the following object

isValidState

  • isValidState(): boolean

toString

  • toString(): string

Generated using TypeDoc