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.
Static Methods
Gets all the module types a given item support.
Returns: Set of supported module types.
Return Type: Set<ModuleData>
Parameter | Type | Description |
---|---|---|
Parameter container | Type ItemStack | Description Module 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>
Parameter | Type | Description |
---|---|---|
Parameter type | Type ModuleData | Description Module 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
Parameter | Type | Description |
---|---|---|
Parameter container | Type ItemStack | Description Module container, for example a Meka-Tool or MekaSuit piece. |
Parameter type | Type ModuleData | Description Module 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>?
Parameter | Type | Description |
---|---|---|
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 |
Gets all the module types on an item stack.
Returns: Module types on an item.
Return Type: Collection<ModuleData>
Parameter | Type | Description |
---|---|---|
Parameter container | Type ItemStack | Description Module container, for example a Meka-Tool or MekaSuit piece. |