InfusionStack
Link to infusionstack
This class was added by a mod with mod-id mekanism
. So you need to have this mod installed if you
want to use this feature.
Importing the class
Link to 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.
ZenScript Copyimport mods.mekanism.api.chemical.InfusionStack;
Implemented Interfaces
Link to implemented-interfaces
InfusionStack implements the following interfaces. That means all methods defined in these interfaces are also available in InfusionStack
Casters
Link to casters
Result type | Is Implicit |
---|---|
Result type CHEMICAL | Is Implicit true |
Result type InfusionStackIngredient | Is Implicit true |
Methods
Link to methods
Name: asImmutable
Makes this stack immutable
Returns: An immutable Stack. This is either a new stack if the current stack is mutable, or the same
stack if it is already immutable.
Return Type: CRT_STACK
ZenScript Copy// InfusionStack.asImmutable() as CRT_STACK
myInfusionStack.asImmutable();
Name: asMutable
Makes this stack mutable
Returns: A new Stack, that is mutable.
Return Type: CRT_STACK
ZenScript Copy// InfusionStack.asMutable() as CRT_STACK
myInfusionStack.asMutable();
Name: containsOther
Checks if this chemical stack, contains the given chemical stack by checking if the chemicals are the same, and if this stack's amount is bigger than the given stack's amount
Returns: true
if this stack contains the other stack
Return Type: boolean
ZenScript CopyInfusionStack.containsOther(stack as CRT_STACK) as boolean
Parameter | Type | Description |
---|---|---|
Parameter stack | Type CRT_STACK | Description Chemical stack 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: CRT_STACK
ZenScript Copy// InfusionStack.copy() as CRT_STACK
myInfusionStack.copy();
Name: getAmount
Gets the size of this chemical stack.
Returns: The size of this chemical stack or zero if it is empty
Return Type: long
ZenScript Copy// InfusionStack.getAmount() as long
myInfusionStack.getAmount();
Name: getRegistryName
Gets the registry name for the chemical this stack is representing.
Returns: A MCResourceLocation representing the registry name.
Return Type: MCResourceLocation
ZenScript Copy// InfusionStack.getRegistryName() as MCResourceLocation
myInfusionStack.getRegistryName();
Name: getType
Retrieves this fluid stack's fluid.
Returns: The fluid.
Return Type: CHEMICAL
ZenScript Copy// InfusionStack.getType() as CHEMICAL
myInfusionStack.getType();
Name: grow
Grows the stack's amount by the given amount in MilliBuckets (MB)
Returns: A new stack, or this stack, depending on if this stack is mutable
Return Type: CRT_STACK
ZenScript CopyInfusionStack.grow(amount as long) as CRT_STACK
Parameter | Type | Description |
---|---|---|
Parameter amount | Type long | Description The amount to grow the stack by. |
Name: isEmpty
Whether this chemical stack is empty.
Returns: true
if this stack is empty, false
otherwise.
Return Type: boolean
ZenScript Copy// InfusionStack.isEmpty() as boolean
myInfusionStack.isEmpty();
Name: isEqual
Checks if this chemical stack is equal another chemical stack.
Returns: true
if the chemicals stacks are equal, false
otherwise.
Return Type: boolean
ZenScript CopyInfusionStack.isEqual(other as CRT_STACK) as boolean
Parameter | Type | Description |
---|---|---|
Parameter other | Type CRT_STACK | Description Chemical stack to check against. |
Name: isTypeEqual
Whether this ChemicalStack's chemical type is equal to the other defined ChemicalStack.
Returns: if the ChemicalStacks contain the same chemical type
Return Type: boolean
ZenScript CopyInfusionStack.isTypeEqual(stack as CRT_STACK) as boolean
Parameter | Type | Description |
---|---|---|
Parameter stack | Type CRT_STACK | Description - ChemicalStack to check |
Name: setAmount
Sets the chemical's amount in MilliBuckets (MB)
Returns: A new stack, or this stack, depending on if this stack is mutable
Return Type: CRT_STACK
ZenScript CopyInfusionStack.setAmount(amount as long) as CRT_STACK
Parameter | Type | Description |
---|---|---|
Parameter amount | Type long | Description The amount to set the stack's amount to. |
Name: shrink
Shrinks the stack's amount by the given amount in MilliBuckets (MB)
Returns: A new stack, or this stack, depending on if this stack is mutable
Return Type: CRT_STACK
ZenScript CopyInfusionStack.shrink(amount as long) as CRT_STACK
Parameter | Type | Description |
---|---|---|
Parameter amount | Type long | Description The amount to shrink the stack by. |
Operators
Link to operators
Name: CONTAINS
Checks if this chemical stack, contains the given chemical stack by checking if the chemicals are
the same, and if this stack's amount is bigger than the given
stack's amount
ZenScript Copystack as CRT_STACK in myInfusionStack
Name: EQUALS
Checks if this chemical stack is equal another chemical stack.
ZenScript CopymyInfusionStack == other as CRT_STACK
Name: MUL
Multiplies the stack's amount by the given amount in MilliBuckets (MB)
ZenScript CopymyInfusionStack * amount as long
Properties
Link to properties
Name | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Name amount | Type long | Has Getter true | Has Setter false | Description Gets the size of this chemical stack. |
Name commandString | Type string | Has Getter true | Has Setter false | Description No Description Provided |
Name empty | Type boolean | Has Getter true | Has Setter false | Description Whether this chemical stack is empty. |
Name registryName | Type MCResourceLocation | Has Getter true | Has Setter false | Description Gets the registry name for the chemical this stack is representing. |
Name type | Type CHEMICAL | Has Getter true | Has Setter false | Description Retrieves this fluid stack's fluid. |