BlockEngine
Index
Namespaces
Classes
Functions
Namespaces
Decorators
ClientSide
Parameters
target: TileEntityBase
propertyName: string
Returns void
ContainerEvent
Adds method as container event in TileEntity
Parameters
side: Side
Returns (target: TileEntityBase, propertyName: string) => void
Parameters
target: TileEntityBase
propertyName: string
Returns void
NetworkEvent
Adds method as network event in TileEntity
Parameters
side: Side
Returns (target: TileEntityBase, propertyName: string) => void
Parameters
target: TileEntityBase
propertyName: string
Returns void
Classes
LiquidTank
Class to store and manipulate liquids in TileEntity.
constructor
Creates new instance of
LiquidTankand binds it to TileEntity.Parameters
tileEntity: TileEntity
TileEntity instance
name: string
liquid tank name
limit: number
max liquid amount
optionalliquids: string[]
types of valid liquids
Returns LiquidTank
data
Liquid data stored in TileEntity data object.
Type declaration
amount: number
liquid: string
limit
Max liquid amount.
liquids
Set of valid liquids
readonlyname
Liquid tank name
tileEntity
Parent TileEntity instance
addLiquid
Adds liquid to tank.
Parameters
liquid: string
liquid type
amount: number
amount of liquid to add
Returns number
amount of liquid that wasn't added
addLiquidToItem
Tries to fill item with liquid from tank.
Parameters
inputSlot: ItemContainerSlot
slot for empty item
outputSlot: ItemContainerSlot
slot for full item
Returns boolean
true if liquid was added, false otherwise.
getAmount
Gets amount of liquid in tank. If
liquidparameter is set, returns amount of the specified liquid.Parameters
optionalliquid: string
liquid type
Returns number
amount of liquid
getLimit
Gets max amount of liquid in tank.
Returns number
amount of liquid
getLiquid
Gets liquid from tank.
Parameters
amount: number
max amount of liquid to get
Returns number
amount of got liquid
getLiquidFromItem
Tries to fill tank with liquid from item.
Parameters
inputSlot: ItemContainerSlot
slot for full item
outputSlot: ItemContainerSlot
slot for empty item
Returns boolean
true if liquid was extracted, false otherwise.
getLiquidStored
Gets type of liquid stored in tank.
Returns string
liquid type
getRelativeAmount
Gets amount of liquid divided by max amount.
Returns number
scalar value from 0 to 1
isEmpty
Returns boolean
true if tank is empty, false otherwise
isFull
Returns boolean
true if tank is full, false otherwise
isValidLiquid
Parameters
liquid: string
liquid type
Returns boolean
true if liquid can be stored in tank, false otherwise.
setAmount
Sets liquid to tank.
Parameters
liquid: string
liquid type
amount: number
amount of liquid
Returns void
setParent
Binds liquid tank to TileEntity.
Parameters
tileEntity: TileEntity
TileEntity instance
Returns void
setValidLiquids
Sets liquids that can be stored in tank.
Parameters
liquids: string[]
arrays of liquid types
Returns void
updateUiScale
Updates UI bar of liquid. Uses LiquidStorage method for legacy container and container event from TileEntityBase for multiplayer container.
Parameters
scale: string
name of liquid bar
Returns void
Functions
getGameVersion
Returns number[]
game version as array
getMainGameVersion
Returns number
main game version number
sendMessage
Sends packet with message which will be translated by the client, the message can be parametrized using '%s' symbols as placeholders.
Parameters
client: NetworkClient
receiver client
message: string
unlocalized string
rest...params: string[]
array of unlocalized substrings that will be substituted into the message after translation
Returns void
sendUnlocalizedMessage
Sends packet with message which will be translated by the client.
That feature is obsoleteUse sendMessage instead.
Parameters
client: NetworkClient
rest...texts: string[]
Returns void
Client side method decorator for TileEntity