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
Copy
import mods.mekanism.api.gear.ModuleHelper;

Name: getSupported

Gets all the module types a given item support.

Returns: Set of supported module types.
Return Type: Set<ModuleData>

ZenScript
Copy
ModuleHelper.getSupported(container as ItemStack) as Set<ModuleData>
ParameterTypeDescription
Parameter
container
Type
ItemStack
Description
Module container, for example a Meka-Tool or MekaSuit piece.

Name: getSupported

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>

ZenScript
Copy
ModuleHelper.getSupported(type as ModuleData) as Set<MCItemDefinition>
ParameterTypeDescription
Parameter
type
Type
ModuleData
Description
Module type.

Name: isEnabled

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

ZenScript
Copy
ModuleHelper.isEnabled(container as ItemStack, type as ModuleData) as boolean
ParameterTypeDescription
Parameter
container
Type
ItemStack
Description
Module container, for example a Meka-Tool or MekaSuit piece.
Parameter
type
Type
ModuleData
Description
Module type.

Name: load

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>?

ZenScript
Copy
ModuleHelper.load<MODULE>(container as ItemStack, type as ModuleData<MODULE>) as Module<MODULE>?
ParameterTypeDescription
Parameter
container
Type
ItemStack
Description
Module container, for example a Meka-Tool or MekaSuit piece.
Parameter
type
Type
ModuleData<MODULE>
Description
Module type.
Parameter
MODULE
Type
Description
No Description Provided

Name: loadAll

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>

ZenScript
Copy
ModuleHelper.loadAll(container as ItemStack) as stdlib.List<Module>
ParameterTypeDescription
Parameter
container
Type
ItemStack
Description
Module container, for example a Meka-Tool or MekaSuit piece.

Name: loadAllTypes

Gets all the module types on an item stack.

Returns: Module types on an item.
Return Type: Collection<ModuleData>

ZenScript
Copy
ModuleHelper.loadAllTypes(container as ItemStack) as Collection<ModuleData>
ParameterTypeDescription
Parameter
container
Type
ItemStack
Description
Module container, for example a Meka-Tool or MekaSuit piece.