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.

ZenScript
Copy
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

ZenScript
Copy
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

ZenScript
Copy
IFluidStack.copy() as IFluidStack
myIFluidStack.copy();
getTag

Returns the NBT tag attached to this FluidStack.

Return Type: IData

ZenScript
Copy
IFluidStack.getTag() as IData
myIFluidStack.getTag();
mutable

Makes this stack mutable

Return Type: IFluidStack

ZenScript
Copy
IFluidStack.mutable() as IFluidStack
myIFluidStack.mutable();
setAmount

Sets the fluid amount in MilliBuckets (mB)

Return Type: IFluidStack

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

Sets the tag for the FluidStack.

Return Type: IFluidStack

ZenScript
Copy
IFluidStack.withTag(tag as IData) as IFluidStack
myIFluidStack.withTag({Display: {lore: ["Hello"]}});
参数类型描述
tagIDataThe tag to set.

运算符

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

ZenScript
Copy
other as IFluidStack in myIFluidStack
MUL

Sets the fluid amount in MilliBuckets (MB)

ZenScript
Copy
myIFluidStack * amount as int
myIFluidStack * 1000

参数

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