ModuleHelper
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
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 mods.mekanism.api.gear.ModuleHelper;Static Methods
Gets all the module types a given item support.
Returns: Set of supported module types.
Return Type: Set<ModuleData>
ModuleHelper.getSupported(container as ItemStack) as Set<ModuleData>| Parameter | Type | Description | 
|---|---|---|
| Parametercontainer | TypeItemStack | DescriptionModule container, for example a Meka-Tool or MekaSuit piece. | 
Helper to get the various items that support a given module type.
Returns: Set of items that support the given module type.
Return Type: Set<MCItemDefinition>
ModuleHelper.getSupported(type as ModuleData) as Set<MCItemDefinition>| Parameter | Type | Description | 
|---|---|---|
| Parametertype | TypeModuleData | DescriptionModule type. | 
Helper method to check if an item has a module installed and the module is enabled.
Returns: true if the item has the module installed and enabled.
Return Type: boolean
ModuleHelper.isEnabled(container as ItemStack, type as ModuleData) as boolean| Parameter | Type | Description | 
|---|---|---|
| Parametercontainer | TypeItemStack | DescriptionModule container, for example a Meka-Tool or MekaSuit piece. | 
| Parametertype | TypeModuleData | DescriptionModule type. | 
Helper method to try and load a module from an item.
Returns: Module, or null if no module of the given type is installed.
Return Type: Module<MODULE>?
ModuleHelper.load<MODULE>(container as ItemStack, type as ModuleData<MODULE>) as Module<MODULE>?| Parameter | Type | Description | 
|---|---|---|
| Parametercontainer | TypeItemStack | DescriptionModule container, for example a Meka-Tool or MekaSuit piece. | 
| Parametertype | TypeModuleData<MODULE> | DescriptionModule type. | 
| ParameterMODULE | Type | DescriptionNo Description Provided | 
Gets a list of all modules on an item stack.
Returns: List of modules on an item, or an empty list if the item doesn’t support modules.
Return Type: stdlib.List<Module>
ModuleHelper.loadAll(container as ItemStack) as stdlib.List<Module>| Parameter | Type | Description | 
|---|---|---|
| Parametercontainer | TypeItemStack | DescriptionModule container, for example a Meka-Tool or MekaSuit piece. | 
Gets all the module types on an item stack.
Returns: Module types on an item.
Return Type: Collection<ModuleData>
ModuleHelper.loadAllTypes(container as ItemStack) as Collection<ModuleData>| Parameter | Type | Description | 
|---|---|---|
| Parametercontainer | TypeItemStack | DescriptionModule container, for example a Meka-Tool or MekaSuit piece. |