Skip to content

Add API/Method to register external IModdedInventory #317

@Shigure-Ruiseki

Description

@Shigure-Ruiseki

Your GTNH Discord Username

ruiseki_001

Feature Request

Summary

Expose a public registry system to allow external mods to register custom IModdedInventory implementations at runtime without needing to modify the InvSeeInventories enum via a Pull Request.

The Problem

Currently, all viewable inventories are hardcoded inside the InvSeeInventories enum. If an external mod or extension wants to add support for a custom container/inventory type via IModdedInventory, it is impossible to do so dynamically. Developers are forced to submit a PR to modify the core enum directly.

Proposed Solution

  1. Create an InvSeeRegistry or add a registration system alongside InvSeeInventories.
  2. Update InvSeeInventories.getActiveInventories() to return a combined list of both the core enum values and the dynamically registered external inventories.

Example:

// How an external mod would register its own invsee logic during initialization
InvSeeRegistry.registerInventory("MyCustomModID", CustomInventory.class);

Final Checklist

  • I have searched the issues and haven't found a similar issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions