Diese Klasse importieren

Link to diese-klasse-importieren

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;

Implemented Interfaces

Link to implemented-interfaces

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

Result typeIs Implicit
Result type
Fluid
Is Implicit
true
Result type
FluidIngredient
Is Implicit
true

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
Copy
IFluidStack.containsOther(other as IFluidStack) as boolean
ParameterTypeBeschreibung
Parameter
other
Type
IFluidStack
Beschreibung
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: 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);
ParameterTypeBeschreibung
Parameter
amount
Type
int
Beschreibung
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"]}});
ParameterTypeBeschreibung
Parameter
tag
Type
MapData
Beschreibung
The tag to set.

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
Copy
other as IFluidStack in myIFluidStack

Name: MUL

Sets the fluid amount in MilliBuckets (MB)

ZenScript
Copy
myIFluidStack * amount as int
myIFluidStack * 1000

Name: OR

ZenScript
Copy
myIFluidStack | other as FluidIngredient
NameTypeHas GetterHas SetterBeschreibung
Name
amount
Type
int
Has Getter
true
Has Setter
false
Beschreibung
Gets the fluid amount in MilliBuckets (mB).
Name
commandString
Type
string
Has Getter
true
Has Setter
false
Beschreibung
Returns the BEP to get this thingy
Name
empty
Type
boolean
Has Getter
true
Has Setter
false
Beschreibung
Gets whether or not this fluid stack is empty.
Name
fluid
Type
Fluid
Has Getter
true
Has Setter
false
Beschreibung
Retrieves this fluid stack's fluid.
Name
hasTag
Type
boolean
Has Getter
true
Has Setter
false
Beschreibung
Returns true if this FluidStack has a Tag
Name
isImmutable
Type
boolean
Has Getter
true
Has Setter
false
Beschreibung
No Description Provided
Name
registryName
Type
ResourceLocation
Has Getter
true
Has Setter
false
Beschreibung
Gets the registry name for the fluid this stack is representing.
Name
tag
Type
MapData
Has Getter
true
Has Setter
false
Beschreibung
Returns the NBT tag attached to this FluidStack.