Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

Properties

isServer: boolean
slots: {}

Type declaration

transactionLock: any

Methods

  • addToSlot(name: string, id: number, count: number, data: number, extra: NativeItemInstanceExtra, player: number): number
  • clearSlot(name: string): void
  • Clears slot's contents

    Parameters

    • name: string

      slot name

    Returns void

  • clone(): any
  • Returns any

  • close(): void
  • dropAt(region: BlockSource, x: number, y: number, z: number): void
  • dropSlot(region: BlockSource, name: string, x: number, y: number, z: number): void
  • Drops slot's contents on the specified coordinates and clears the slot

    Parameters

    • region: BlockSource
    • name: string

      slot name

    • x: number
    • y: number
    • z: number

    Returns void

  • equals(param0: any): boolean
  • Parameters

    • param0: any

    Returns boolean

  • finalize(): void
  • Returns void

  • getClass(): Class<any>
  • Returns Class<any>

  • getClientContainerTypeName(): string
  • getFromSlot(name: string, id: number, count: number, data: number, extra: NativeItemInstanceExtra, player: number): number
  • getNetworkName(): string
  • getParent(): any
  • getText(elementName: string): string
  • Parameters

    • elementName: string

      element name

    Returns string

    "text" binding value, usually the text displayed on the element, or null if no element with specified name exist

  • getValue(elementName: string, value: number): number
  • Parameters

    • elementName: string

      element name

    • value: number

    Returns number

    "value" binding value, e.g. scale value, or null if no element with specified name exist

  • handleDirtyBindingsPacket(client: NetworkClient, packet: JSONObject): void
  • handleInventoryToSlotTransaction(player: number, inventorySlot: number, slotName: string, amount: number): void
  • Parameters

    • player: number
    • inventorySlot: number
    • slotName: string
    • amount: number

    Returns void

  • handleSlotToInventoryTransaction(player: number, slotName: string, inventorySlot: number, amount: number): void
  • Parameters

    • player: number
    • slotName: string
    • inventorySlot: number
    • amount: number

    Returns void

  • handleSlotToSlotTransaction(player: number, slot1: string, slot2: string, amount: number): void
  • Parameters

    • player: number
    • slot1: string
    • slot2: string
    • amount: number

    Returns void

  • hashCode(): number
  • Returns number

  • isGlobalSlotSavingEnabled(): boolean
  • isLegacyContainer(): false
  • isSlotSavingEnabled(name: string): boolean
  • markAllSlotsDirty(): void
  • markSlotDirty(name: string): void
  • notify(): void
  • Returns void

  • notifyAll(): void
  • Returns void

  • Opens UI for client

    Parameters

    • client: NetworkClient

      client in which UI will be open

    • screenName: string

      name of the screen to open

    Returns void

  • removeEntity(): void
  • resetSlotSavingEnabled(name: string): void
  • sealAllSlots(): void
  • sealSlot(slotName: string): void
  • sendChanges(): void
  • Sends changes in container to all clients. Needs to be used every time when something changes in container.

    Returns void

  • sendClosed(): void
  • sendInventoryToSlotTransaction(inventorySlot: number, slotName: string, amount: number): void
  • Sends event to move specified amount of items from the player inventory slot by given index to container slot by given name. This event is sent from client to server, so you should use it only on the client side, for example, in custom slot element touch events etc.

    clientside

    Parameters

    • inventorySlot: number

      numeric index of the inventory slot, from where to retrieve the item

    • slotName: string

      string name of the container slot, where to put taken item

    • amount: number

      item count to be retrieved from inventory slot

    Returns void

  • sendResponseEvent(name: string, data: string | PacketData): void
  • Sends packet from server container. ONLY AVAILABLE IN SERVER CONTAINER EVENTS

    Parameters

    Returns void

  • sendSlotToInventoryTransaction(slot: string, amount: number): void
  • Sends event to move specified amount of items from the container slot by given name to player's inventory. The index of the inventory slot, where to put item, can't be specified, because it's decided by ItemContainer automatically, and you just don't need to do this. This event is sent from client to server, so you should use it only on the client side, for example, in custom slot element touch events etc.

    clientside

    Parameters

    • slot: string

      string name of the container slot, from where to retrieve item

    • amount: number

      item count to be retrieved from container slot

    Returns void

  • sendSlotToSlotTransaction(slot1: string, slot2: string, amount: number): void
  • Sends event to move specified amount of items from one container slot to another by given names. This event is sent from client to server, so you should use it only on the client side, for example, in custom slot element touch events etc.

    clientside

    Parameters

    • slot1: string

      string name of the container slot, from where to retrieve item

    • slot2: string

      string name of the container slot, where to put taken item

    • amount: number

      item count to be retrieved from container slot

    Returns void

  • setBinding(composedBindingName: string, value: PrimitiveTypes): void
  • setBinding(elementName: string, bindingName: string, value: PrimitiveTypes): void
  • setBindingValidator(composedBindingName: string, validator: BindingValidator): void
  • setClientBinding(composedBindingName: string, value: PrimitiveTypes): void
  • setClientBinding(elementName: string, bindingName: string, value: PrimitiveTypes): void
  • setClientContainerTypeName(type: string): void
  • setClientScale(elementName: string, value: number): void
  • setClientText(elementName: string, text: string): void
  • setGlobalSlotSavingEnabled(enabled: boolean): void
  • setParent(parent: any): void
  • Sets container's parent object, for TileEntity's container it should be a TileEntity reference, otherwise you can pass any value to be used in your code later

    Parameters

    • parent: any

      an object to be set as container's parent

    Returns void

  • setScale(elementName: string, value: number): void
  • Sets "value" binding value for the element. Used to set scales values

    Parameters

    • elementName: string

      element name

    • value: number

      value to be set for the element

    Returns void

  • setSlotSavingEnabled(name: string, enabled: boolean): void
  • setText(elementName: string, text: string | number): void
  • Sets "text" binding value for the element. Used to set element's text

    Parameters

    • elementName: string

      element name

    • text: string | number

      value to be set for the element

    Returns void

  • setWorkbenchFieldPrefix(prefix: string): void
  • toString(): string
  • Returns string

  • validateAll(): void
  • validateSlot(name: string): void
  • Validates slot contents. If the data value is less then 0, it becomes 0, if id is 0 or count is less then or equals to zero, slot is reset to an empty one

    Parameters

    • name: string

      slot name

    Returns void

  • wait(): void
  • wait(param0: number): void
  • wait(param0: number, param1: number): void
  • Returns void

  • Parameters

    • param0: number

    Returns void

  • Parameters

    • param0: number
    • param1: number

    Returns void

  • addClientEventListener(typeName: string, packetName: string, listener: ClientEventListener): void
  • loadClass(): void

Generated using TypeDoc