fabric-loader icon indicating copy to clipboard operation
fabric-loader copied to clipboard

Conditionally apply mixins

Open Pannoniae opened this issue 6 years ago • 6 comments

Currently, to conditionally do something, you have virtually 2 choices. 1.

if (disabledFeature) return;
  1. IMixinConfigPlugin. This is powerful, although slightly harder to use.

I think the mixin JSON could be extended to allow a condition to be passed next to the applicable mixin.

Pannoniae avatar Feb 04 '19 19:02 Pannoniae

The format now allows potential appending of fields to the mixins list, as of 0.4.0.

asiekierka avatar Mar 05 '19 20:03 asiekierka

Can this be closed then?

Pannoniae avatar Mar 05 '19 21:03 Pannoniae

No. You still need to use IMixinConfigPlugin.

asiekierka avatar Mar 05 '19 21:03 asiekierka

Can't we just always stick to mixin config plugins for conditional application? This is what sponge has been always doing. Need to take a stance on this and decide whether to kill this issue.

liach avatar Nov 24 '19 05:11 liach

Just use IMixinConfigPlugin, it trivial to use and standard across Mixin environments - no need to introduce a Fabric-specific concept for this.

jamierocks avatar Jul 31 '20 11:07 jamierocks

We don't (officially) support mixin plugins, they don't work well with planned features like pre-baking bytecode edits and are too easy to mess up by loading classes that shouldn't be at this stage.

Player3324 avatar Jul 31 '20 11:07 Player3324