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

abstractTileEntityBase

Hierarchy

Implements

  • TileEntity

Indexable

[key: string]: any

Index

Constructors

constructor

Properties

__clientMethods

__clientMethods: {}

Type declaration

  • [key string]: boolean

__containerEvents

__containerEvents: {}

Type declaration

__initialized

__initialized: boolean

__networkEvents

__networkEvents: {}

Type declaration

private_clickPrevented

_clickPrevented: any

private_runInit

_runInit: any

readonlyblockID

blockID: number

blockSource

blockSource: BlockSource

click

click: (id: number, count: number, data: number, coords: ItemUseCoordinates, player: number, extra: ItemExtraData) => boolean | void

Type declaration

    • (id: number, count: number, data: number, coords: ItemUseCoordinates, player: number, extra: ItemExtraData): boolean | void
    • Parameters

      • id: number
      • count: number
      • data: number
      • coords: ItemUseCoordinates
      • player: number
      • extra: ItemExtraData

      Returns boolean | void

client

client: { containerEvents: {}; events: {}; load: () => void; tick: () => void; unload: () => void }

Type declaration

  • containerEvents: {}
    • [eventName string]: (container: ItemContainer, window: UI.IWindow | null, windowContent: UI.WindowContent | null, eventData: any) => void
  • events: {}
    • [packetName string]: (packetData: any, packetExtra: any) => void
  • load: () => void
      • (): void
      • Returns void

  • tick: () => void
      • (): void
      • Returns void

  • unload: () => void
      • (): void
      • Returns void

container

container: ItemContainer

containerEvents

containerEvents: {}

Type declaration

  • [eventName string]: (container: ItemContainer, window: UI.IWindow | null, windowContent: UI.WindowContent | null, eventData: any) => void

data

data: {}

Type declaration

  • [key string]: any

defaultValues

defaultValues: {}

Type declaration

    readonlydimension

    dimension: number

    events

    events: {}

    Type declaration

    • [packetName string]: (packetData: any, packetExtra: any, connectedClient: NetworkClient) => void

    getGuiScreen

    getGuiScreen: () => Nullable<IWindow>

    Type declaration

      • (): Nullable<IWindow>
      • Returns Nullable<IWindow>

    isLoaded

    isLoaded: boolean

    liquidStorage

    liquidStorage: Storage

    networkData

    networkData: SyncedNetworkData

    networkEntity

    networkEntity: NetworkEntity

    networkEntityType

    networkEntityType: NetworkEntityType

    networkEntityTypeName

    networkEntityTypeName: string

    noupdate

    noupdate: boolean

    optionalonConnectionPlayer

    onConnectionPlayer?: (client: NetworkClient) => void

    Type declaration

      • (client: NetworkClient): void
      • Parameters

        • client: NetworkClient

        Returns void

    optionalonDisconnectionPlayer

    onDisconnectionPlayer?: (client: NetworkClient) => void

    Type declaration

      • (client: NetworkClient): void
      • Parameters

        • client: NetworkClient

        Returns void

    region

    region: WorldRegion

    Interface for BlockSource of the TileEntity. Provides more functionality.

    remove

    remove: boolean

    sendPacket

    sendPacket: (name: string, data: object) => {}

    Type declaration

      • (name: string, data: object): {}
      • Parameters

        • name: string
        • data: object

        Returns {}

      sendResponse

      sendResponse: (packetName: string, someData: object) => {}

      Type declaration

        • (packetName: string, someData: object): {}
        • Parameters

          • packetName: string
          • someData: object

          Returns {}

        update

        update: () => void

        Type declaration

          • (): void
          • Returns void

        readonlyuseNetworkItemContainer

        useNetworkItemContainer: boolean

        x

        x: number

        y

        y: number

        z

        z: number

        Methods

        clientLoad

        • clientLoad(): void
        • Called when the client copy is created


          Returns void

        clientTick

        • clientTick(): void
        • Called every tick on client thread


          Returns void

        clientUnload

        • clientUnload(): void
        • Called on destroying the client copy


          Returns void

        created

        • created(): void
        • Returns void

        destroy

        • destroy(): boolean
        • Returns boolean

        destroyBlock

        • destroyBlock(coords: ItemUseCoordinates, player: number): void
        • Parameters

          • coords: ItemUseCoordinates
          • player: number

          Returns void

        getScreenByName

        • getScreenByName(screenName: string, container: ItemContainer): IWindow
        • Parameters

          • screenName: string
          • container: ItemContainer

          Returns IWindow

        getScreenName

        • getScreenName(player: number, coords: ItemUseCoordinates): string
        • Parameters

          • player: number
          • coords: ItemUseCoordinates

          Returns string

        init

        • init(): void
        • @deprecated

          Returns void

        load

        • load(): void
        • @deprecated

          Returns void

        onCheckerTick

        • onCheckerTick(isInitialized: boolean, isLoaded: boolean, wasLoaded: boolean): void
        • Parameters

          • isInitialized: boolean
          • isLoaded: boolean
          • wasLoaded: boolean

          Returns void

        onCreate

        • onCreate(): void
        • Called when a TileEntity is created


          Returns void

        onInit

        • onInit(): void
        • Called when a TileEntity is initialised in the world


          Returns void

        onItemClick

        • onItemClick(id: number, count: number, data: number, coords: ItemUseCoordinates, player: number, extra: ItemExtraData): boolean
        • Parameters

          • id: number
          • count: number
          • data: number
          • coords: ItemUseCoordinates
          • player: number
          • extra: ItemExtraData

          Returns boolean

        onItemUse

        • onItemUse(coords: ItemUseCoordinates, item: ItemStack, player: number): boolean
        • Called when player uses some item on a TileEntity. Replaces "click" function.


          Parameters

          • coords: ItemUseCoordinates
          • item: ItemStack
          • player: number

          Returns boolean

          true if should prevent opening UI.

        onLoad

        • onLoad(): void
        • Called when a chunk with TileEntity is loaded


          Returns void

        onRedstoneUpdate

        • onRedstoneUpdate(signal: number): void
        • Occurs when redstone signal on TileEntity block was updated


          Parameters

          • signal: number

            signal power (0-15)

          Returns void

        onTick

        • onTick(): void
        • Called every tick and should be used for all the updates of the TileEntity


          Returns void

        onUnload

        • onUnload(): void
        • Called when a chunk with TileEntity is unloaded


          Returns void

        preventClick

        • preventClick(): void
        • Prevents all actions on click


          Returns void

        projectileHit

        • projectileHit(coords: ItemUseCoordinates, target: ProjectileHitTarget): void
        • Parameters

          • coords: ItemUseCoordinates
          • target: ProjectileHitTarget

          Returns void

        redstone

        • redstone(params: { onLoad: boolean; power: number; signal: number }): void
        • @deprecated

          Parameters

          • params: { onLoad: boolean; power: number; signal: number }
            • onLoad: boolean
            • power: number
            • signal: number

          Returns void

        requireMoreLiquid

        • requireMoreLiquid(liquid: string, amount: number): void
        • Parameters

          • liquid: string
          • amount: number

          Returns void

        selfDestroy

        • selfDestroy(): void
        • Returns void

        setLiquidScale

        • setLiquidScale(container: any, window: any, content: any, data: { amount: number; liquid: string; scale: string }): void
        • Parameters

          • container: any
          • window: any
          • content: any
          • data: { amount: number; liquid: string; scale: string }
            • amount: number
            • liquid: string
            • scale: string

          Returns void

        tick

        • tick(): void
        • @deprecated

          Returns void

        unload

        • unload(): void
        • @deprecated

          Returns void

        updateLiquidScale

        • updateLiquidScale(scale: string, liquid: string): void
        • Parameters

          • scale: string
          • liquid: string

          Returns void