IFluidStack

导入相关包

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.

import crafttweaker.api.fluid.IFluidStack;

已实现的接口

IFluidStack implements the following interfaces. That means all methods defined in these interfaces are also available in IFluidStack

Casters

结果类型是否隐藏
MCFluidtrue

方法

containsOther

Checks if this IFluidStack, contains the given IFluidStack by checking if the fluids are the same, and if this fluid's amount is bigger than the given fluid's amount

Return Type: boolean

IFluidStack.containsOther(other as IFluidStack) as boolean
参数类型描述
otherIFluidStackother IFluidStack to compare against

copy #复制

Copies the stack. Only needed when mutable stacks are involved.

Return Type: IFluidStack

IFluidStack.copy() as IFluidStack
myIFluidStack.copy();

可变的

Makes this stack mutable

Return Type: IFluidStack

IFluidStack.mutable() as IFluidStack
myIFluidStack.mutable();

setAmount

Sets the fluid amount in MilliBuckets (mB)

Return Type: IFluidStack

IFluidStack.setAmount(amount as int) as IFluidStack
myIFluidStack.setAmount(1000);
参数类型描述
amountintThe amount to multiply this stack

运算符

CONTAINS

Checks if this IFluidStack, contains the given IFluidStack by checking if the fluids are the same, and if this fluid's amount is bigger than the given fluid's amount

other as IFluidStack in myIFluidStack

MUL

Sets the fluid amount in MilliBuckets (MB)

myIFluidStack * amount as int
myIFluidStack * 1000

参数

名称类型可获得可设置
amountinttruefalse
commandStringstringtruefalse
emptybooleantruefalse
fluidMCFluidtruefalse
registryNameMCResourceLocationtruefalse