IFluidStack
Link to ifluidstack
Importare la Classe
Link to importare-la-classe
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.fluid.IFluidStack;
Interfacce Implementate
Link to interfacce-implementate
IFluidStack implements the following interfaces. That means all methods defined in these interfaces are also available in IFluidStack
Caster
Link to caster
Result Type | Implicito |
---|---|
Result Type Fluid | Implicito sì |
Result Type FluidIngredient | Implicito sì |
Result Type IData | Implicito sì |
Metodi
Link to metodi
Name: asIData
Return Type: IData
ZenScript Copy// IFluidStack.asIData() as IData
myIFluidStack.asIData();
Name: asImmutable
Return Type: IFluidStack
ZenScript Copy// IFluidStack.asImmutable() as IFluidStack
myIFluidStack.asImmutable();
Name: 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
Returns: true if this fluid contains the other fluid
Return Type: boolean
ZenScript CopyIFluidStack.containsOther(other as IFluidStack) as boolean
Parametro | Tipo | Descrizione |
---|---|---|
Parametro other | Tipo IFluidStack | Descrizione other IFluidStack to compare against |
Name: copy
Copies the stack. Only needed when mutable stacks are involved.
Returns: A new stack, that contains the same info as this one
Return Type: IFluidStack
ZenScript Copy// IFluidStack.copy() as IFluidStack
myIFluidStack.copy();
Name: getCommandString
Returns the BEP to get this thingy
Return Type: string
ZenScript Copy// IFluidStack.getCommandString() as string
myIFluidStack.getCommandString();
Name: getTag
Returns the NBT tag attached to this FluidStack.
Returns: MapData of the FluidStack's NBT Tag, null if it doesn't exist.
Return Type: MapData
ZenScript Copy// IFluidStack.getTag() as MapData
myIFluidStack.getTag();
Name: isImmutable
Return Type: boolean
ZenScript Copy// IFluidStack.isImmutable() as boolean
myIFluidStack.isImmutable();
Name: mutable
Makes this stack mutable
Returns: A new Stack, that is mutable.
Return Type: IFluidStack
ZenScript Copy// IFluidStack.mutable() as IFluidStack
myIFluidStack.mutable();
Name: setAmount
Sets the fluid amount in MilliBuckets (mB)
Returns: A new stack, or this stack, depending if this stack is mutable
Return Type: IFluidStack
ZenScript Copy// IFluidStack.setAmount(amount as int) as IFluidStack
myIFluidStack.setAmount(1000);
Parametro | Tipo | Descrizione |
---|---|---|
Parametro amount | Tipo int | Descrizione The amount to multiply this stack |
Name: withTag
Sets the tag for the FluidStack.
Returns: This FluidStack if it is mutable, a new one with the changed property otherwise
Return Type: IFluidStack
ZenScript Copy// IFluidStack.withTag(tag as MapData?) as IFluidStack
myIFluidStack.withTag({Display: {lore: ["Hello"]}});
Parametro | Tipo | Descrizione |
---|---|---|
Parametro tag | Tipo MapData? | Descrizione The tag to set. |
Operators
Link to operators
Name: 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 Copyother as IFluidStack in myIFluidStack
Name: MUL
Sets the fluid amount in MilliBuckets (MB)
ZenScript CopymyIFluidStack * amount as int
myIFluidStack * 1000
Name: OR
ZenScript CopymyIFluidStack | other as FluidIngredient
Proprietà
Link to proprietà
Nome | Tipo | Ha Getter | Ha Setter | Descrizione |
---|---|---|---|---|
Nome amount | Tipo int | Ha Getter sì | Ha Setter no | Descrizione Gets the fluid amount in MilliBuckets (mB). |
Nome commandString | Tipo string | Ha Getter sì | Ha Setter no | Descrizione Returns the BEP to get this thingy |
Nome empty | Tipo boolean | Ha Getter sì | Ha Setter no | Descrizione Gets whether or not this fluid stack is empty. |
Nome fluid | Tipo Fluid | Ha Getter sì | Ha Setter no | Descrizione Retrieves this fluid stack's fluid. |
Nome hasTag | Tipo boolean | Ha Getter sì | Ha Setter no | Descrizione Returns true if this FluidStack has a Tag |
Nome isImmutable | Tipo boolean | Ha Getter sì | Ha Setter no | Descrizione |
Nome registryName | Tipo ResourceLocation | Ha Getter sì | Ha Setter no | Descrizione Gets the registry name for the fluid this stack is representing. |
Nome tag | Tipo MapData | Ha Getter sì | Ha Setter no | Descrizione Returns the NBT tag attached to this FluidStack. |