IFluidHandler
Link to ifluidhandler
Импорт класса
Link to импорт-класса
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.capability.IFluidHandler;
Методы
Link to методы
Name: drain
Drains fluid out of the internal tanks.
Returns: A new FluidStack representing the fluid that was drained along with how much was drained.
Return Type: IFluidStack
ZenScript Copy// IFluidHandler.drain(maxDrain as int, action as IFluidHandlerAction) as IFluidStack
myIFluidHandler.drain(400, <constant:forge:fluid_action:execute>);
Параметр | Тип | Описание |
---|---|---|
Параметр maxDrain | Тип int | Описание How much fluid should be drained. |
Параметр action | Тип IFluidHandlerAction | Описание Determines if the drain is simulated or executed. |
Name: drain
Drains fluid out of the internal tanks.
Returns: A new FluidStack representing the fluid that was drained along with how much was drained.
Return Type: IFluidStack
ZenScript Copy// IFluidHandler.drain(resource as IFluidStack, action as IFluidHandlerAction) as IFluidStack
myIFluidHandler.drain(<fluid:minecraft:water> * 400, <constant:forge:fluid_action:execute>);
Параметр | Тип | Описание |
---|---|---|
Параметр resource | Тип IFluidStack | Описание The fluid and the maximum amount of the fluid to drain. |
Параметр action | Тип IFluidHandlerAction | Описание Determines if the drain is simulated or executed. |
Name: fill
Fills the internal tanks with the given fluid.
Returns: The amount of the fluid that will be used by the fill.
Return Type: int
ZenScript Copy// IFluidHandler.fill(resource as IFluidStack, action as IFluidHandlerAction) as int
myIFluidHandler.fill(<fluid:minecraft:water>, <constant:forge:fluid_action:execute>);
Параметр | Тип | Описание |
---|---|---|
Параметр resource | Тип IFluidStack | Описание The fluid to fill. |
Параметр action | Тип IFluidHandlerAction | Описание Determines if the fill is simulated or executed. |
Name: getFluidInTank
Gets the fluid in the given tank.
Returns: The fluid in the tank.
Return Type: IFluidStack
ZenScript Copy// IFluidHandler.getFluidInTank(tank as int) as IFluidStack
myIFluidHandler.getFluidInTank(0);
Параметр | Тип | Описание |
---|---|---|
Параметр tank | Тип int | Описание The tank to get the fluid of. |
Name: getTankCapacity
Gets the capacity of the given tank.
Returns: The capacity of the given tank.
Return Type: int
ZenScript Copy// IFluidHandler.getTankCapacity(tank as int) as int
myIFluidHandler.getTankCapacity(0);
Параметр | Тип | Описание |
---|---|---|
Параметр tank | Тип int | Описание The tank to get the capacity of. |
Name: getTanks
Gets the number of tanks in this fluid handler.
A single handler can have many tanks holding different fluids
Returns: The number of tanks in this fluid handler.
Return Type: int
ZenScript Copy// IFluidHandler.getTanks() as int
myIFluidHandler.getTanks();
Name: isFluidValid
Checks if the given fluid is valid for the given tank.
Returns: true if the fluid is valid, false otherwise.
Return Type: boolean
ZenScript Copy// IFluidHandler.isFluidValid(tank as int, stack as IFluidStack) as boolean
myIFluidHandler.isFluidValid(0, <fluid:minecraft:water>);
Параметр | Тип | Описание |
---|---|---|
Параметр tank | Тип int | Описание The tank to check. |
Параметр stack | Тип IFluidStack | Описание The fluid to check. |
Свойства
Link to свойства
Название | Тип | Имеет Getter | Имеет Setter | Описание |
---|---|---|---|---|
Название tanks | Тип int | Имеет Getter true | Имеет Setter false | Описание Gets the number of tanks in this fluid handler. A single handler can have many tanks holding different fluids |