Skip to content

[7.0] Add support for transitive injected interfaces with Facade #1080

Description

@PaintNinja

AccessTransformers deliberately don't apply transitively because there's no easy way of knowing if MC had something public or if one of your dependencies changed it, which can result in unintended reliance on a mod's build time optional dependencies.

Interface injection on the other hand doesn't change existing code - it adds new methods to an existing class, and you can see where the methods are coming from because they're on the interface, not the class the interface is applied to. The risk of accidentally relying on another mod is reduced as they can see in their IDE that a new method they're referencing is coming from a non-MC package.

Some mods like GeckoLib heavily rely on interface injection to extend vanilla MC's APIs, as alternatives like utility methods and wrapping aren't as nice for API users to work with, are more effort to maintain and less performant. Currently mod devs need to setup Facade in their own project and manually check that their Facade config matches each of their deps in order to use them, it would be nice if injected interfaces applied transitively so that they'd work out of the box. It could also be handy for Forge, as some patches that inject interfaces could be replaced with a Facade config instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions