SerenityJS
    Preparing search index...

    Class BlockWallConnectionTrait

    Connects walls to the blocks next to them, and raises their posts.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    block: Block

    The block that this trait is attached to.

    component: null | typeof BlockTypeComponent = ...

    The block component that this trait is attached to.

    dimension: Dimension

    The dimension that the block is in.

    identifier: string = ...

    The identifier of the trait.

    state: null | string = ...

    The block state key that this trait is attached to.

    tag: null | string = ...

    The block tag that this trait is attached to.

    component: null | typeof BlockTypeComponent = null

    The block component that this trait is compatible with by default. If null, the trait will not attach to any block by default.

    identifier: "wall_connection"

    The identifier of the trait.

    sides: BlockSide[] = ...

    The horizontal sides of a block.

    state: "wall_post_bit"

    The block state key that this trait is compatible with by default. If null, the trait will not be initialized by any block state.

    tag: null | string = null

    The block tag that this trait is compatible with by default. If null, the trait will not attach to any block by default.

    types: string[] = []

    The block type identifiers that this trait is compatible with by default.

    Methods

    • Breaks the block on the next tick, dropping it, if it is still not held up then. Breaking a block updates its neighbours, so blocks held up by one another break one per tick, as in vanilla, rather than all at once, which spreads the work of breaking many blocks over many ticks.

      Parameters

      • isSupported: () => boolean

        Checks whether the block is held up.

      Returns void

    • Sets the probability of this trait being randomly ticked each tick.

      Parameters

      • numerator: number

        The numerator of the probability fraction.

      • denominator: number

        The denominator of the probability fraction.

      Returns void

    • Wether this trait should be randomly ticked this tick.

      Parameters

      • factor: number = 1

        A factor to multiply the chance by. Default is 1.

      Returns boolean

      True if the trait should be randomly ticked, false otherwise.