MixinExtras
MixinExtras copied to clipboard
Deliberate conflict marker
Add an annotation (say, @Conflict), that can be added to an injector to mark it as conflicting with other injectors that target the same instruction. This tells MixinExtras to fail the injection in this case.
This has the following advantages:
- Ability to explicitly conflict with other injectors in cases where this is not currently possible (e.g. with injection points that can only be used on non-conflicting injectors)
- Clarifies the intention that the injector should be conflicting
- This makes it easier for tools such as mcdev to know if a conflicting injector is intentional.
- Possibility for future expansion of scope (e.g. conflicting under certain conditions)
Would it cause conflicts only with other injectors marked as Conflicting?
My idea was to conflict with any injector which targets the same instruction, regardless of what that other injector is or how it's annotated. But more complicated options could certainly be added to the annotation
I would request a @NoConflict annotation (or similar name) that can override this but will blame the mod using it prominently in crash logs.
@NoConflict should only apply if the mixin class it is in has a higher priority than other mixin classes that are applying a @Conflict to the targeted instruction. A way to limit the @NoConflict to specific mixin classes could be useful too.
My usecase is that I might want to carefully write an injector that I'm willing to guarantee will be compatible with a specific other mod (but of course I should then get the blame if things explode).