Перейти к основному содержанию

BlockState

Class to work with vanilla blocks parameters.

@since

2.2.1b89

Implements

Index

Constructors

constructor

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


    Parameters

    • id: number
    • data: number

    Returns BlockState

Properties

readonlydata

data: number

Data of the block.

readonlyid

id: number

Numeric ID of the block.

Methods

addState

  • addState(state: number, value: number): BlockState
  • Adds state to the following object.


    Parameters

    • state: number
    • value: number

    Returns BlockState

    BlockState object itself.

addStates

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

    @since

    2.2.1b102


    Parameters

    • states: object

    Returns BlockState

    BlockState object itself.

addStatesMap

  • addStatesMap(states: Map<unknown, number>): BlockState
  • Adds states to the following object from given map instance.

    @since

    2.2.1b102


    Parameters

    • states: Map<unknown, number>

    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

  • Returns number

    Data of the block.

getId

  • getId(): number

  • Returns number

    ID of the block.

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

  • Returns number

    ID of the blockstate in runtime.

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

  • Returns boolean

    Whether the state is valid.