API suggestion - using InterModCommits

  • Forge InterModCommits are proposed to be used for cases when you need to add/remove/edit some value in some registry and they are work very well for it.
    They allow other mods to do things they need without using API code.
    In addition, it hides implementation and provides only actual interface. That is good for code extending and maintaining. For example, suppose you want to change Set<Block> in ExplosionWhitelist to Set<IBlockState> - this change will break API; using some kind of IMC-based registry you can easily do it by treating messages without meta/state as wildcard.


    Some things in IC2Experimental API are clear candidates to use IMC. For example, ExplosionWhitelist, IMetalArmor, IScrapboxManager.

    His Superior Darkness Earl Cat blesses everybody who reads this with aroma of catnip and bergamot. :Industrial Diamond:

    • Official Post

    IScrapboxManager: The idea with the recipe managers in general is to have the registrytion and the recipe lookups in the same place. Using IMCs for registration, but keeping the interface for recipe lookups would be quite unnatural.
    IMetalArmor: that is probably something, where it would be good to have IMCs or some other kind of registry for.
    ExplosionWhitelist: maybe.We may do that during the next MC update, but right now, it wouldn't be good to change the API to use IMCs instead.