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

LiquidItemRegistry

Registry for liquid storage items. Compatible with LiquidRegistry and extends it by adding items that can contain partial amounts of liquid.

Index

Type Aliases

EmptyData

EmptyData: { amount: number; data: number; id: number; liquid: string; storage?: number }

Object that contains empty liquid storage item and stored liquid data.

@id

item id

@data

item data

@liquid

liquid type

@amount

liquid amount able to be extracted

@storage

liquid storage of items registered by BlockEngine.


Type declaration

  • amount: number
  • data: number
  • id: number
  • liquid: string
  • optionalstorage?: number

FullData

FullData: { amount: number; data: number; id: number; storage?: number }

Object that contains full item and free liquid capacity.

@id

item id

@data

item data

@liquid

liquid type

@amount

free liquid capacity

@storage

liquid storage of items registered by BlockEngine.


Type declaration

  • amount: number
  • data: number
  • id: number
  • optionalstorage?: number

Variables

constEmptyByFull

EmptyByFull: {}

Type declaration

    constFullByEmpty

    FullByEmpty: {}

    Type declaration

      Functions

      getEmptyItem

      • getEmptyItem(id: number, data: number): EmptyData
      • Returns empty item and stored liquid data for item that contains liquid, null otherwise.


        Parameters

        • id: number

          item id

        • data: number

          item data

        Returns EmptyData

        object that contains empty item and stored liquid.

      getFullItem

      • getFullItem(id: number, data: number, liquid: string): FullData
      • Returns full item and free liquid capacity for item that can be filled with liquid, null otherwise.


        Parameters

        • id: number

          item id

        • data: number

          item data

        • liquid: string

          liquid type

        Returns FullData

        object that contains full item and free liquid capacity

      getItemLiquid

      • getItemLiquid(id: number, data: number): string
      • Return liquid type stored in item


        Parameters

        • id: number

          item id

        • data: number

          item data

        Returns string

        liquid type

      registerItem

      • registerItem(liquid: string, emptyId: number, fullId: number, storage: number): void
      • Registers liquid storage item.


        Parameters

        • liquid: string

          liquid name

        • emptyId: number

          empty item id

        • fullId: number

          id of item with luquid

        • storage: number

          capacity of liquid in mB

        Returns void