IFluidStack
Importing the class
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;
Implemented Interfaces
IFluidStack implements the following interfaces. That means all methods defined in these interfaces are also available in IFluidStack
Casters
Methods
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
Parameter | Type | Description |
---|
other | IFluidStack | other IFluidStack to compare against |
Copies the stack. Only needed when mutable stacks are involved.
Return Type: IFluidStack
IFluidStack.copy() as IFluidStack
myIFluidStack.copy();
Returns the NBT tag attached to this FluidStack.
Return Type: IData
IFluidStack.getTag() as IData
myIFluidStack.getTag();
Makes this stack mutable
Return Type: IFluidStack
IFluidStack.mutable() as IFluidStack
myIFluidStack.mutable();
Sets the fluid amount in MilliBuckets (mB)
Return Type: IFluidStack
IFluidStack.setAmount(amount as int) as IFluidStack
myIFluidStack.setAmount(1000);
Parameter | Type | Description |
---|
amount | int | The amount to multiply this stack |
Sets the tag for the FluidStack.
Return Type: IFluidStack
IFluidStack.withTag(tag as IData) as IFluidStack
myIFluidStack.withTag({Display: {lore: ["Hello"]}});
Parameter | Type | Description |
---|
tag | IData | The tag to set. |
Operators
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
Sets the fluid amount in MilliBuckets (MB)
myIFluidStack * amount as int
myIFluidStack * 1000
Properties
Name | Type | Has Getter | Has Setter |
---|
amount | int | true | false |
commandString | string | true | false |
empty | boolean | true | false |
fluid | MCFluid | true | false |
hasTag | boolean | true | false |
registryName | format@@0 MCRessourceLocation | true | false |
tag | IData | true | false |