public interface IMixinConfigPlugin
A companion plugin for a mixin configuration object. Objects implementing this interface get some limited power of veto over the mixin load process as well as an opportunity to apply their own transformations to the target class pre- and post-transform. Since all methods in this class are called indirectly from the transformer, the same precautions as for writing class transformers should be taken. Implementors should take care to not reference any game classes, and avoid referencing other classes in their own mod except those specificially designed to be available at early startup, such as coremod classes or other standalone bootstrap objects.
Instances of plugins are created by specifying the "plugin" key in the mixin config JSON as the fully-qualified class name of a class implementing this interface.
| Modifier and Type | Method and Description |
|---|---|
void |
acceptTargets(java.util.Set<java.lang.String> myTargets,
java.util.Set<java.lang.String> otherTargets)
Called after all configurations are initialised, this allows this plugin
to observe classes targetted by other mixin configs and optionally remove
targets from its own set.
|
java.util.List<java.lang.String> |
getMixins()
After mixins specified in the configuration have been processed, this
method is called to allow the plugin to add any additional mixins to
load.
|
java.lang.String |
getRefMapperConfig()
Called only if the "referenceMap" key in the config is not set.
|
void |
onLoad(java.lang.String mixinPackage)
Called after the plugin is instantiated, do any setup here.
|
void |
postApply(java.lang.String targetClassName,
org.objectweb.asm.tree.ClassNode targetClass,
java.lang.String mixinClassName,
IMixinInfo mixinInfo)
Called immediately after a mixin is applied to a target class,
allows any post-application transformations to be applied.
|
void |
preApply(java.lang.String targetClassName,
org.objectweb.asm.tree.ClassNode targetClass,
java.lang.String mixinClassName,
IMixinInfo mixinInfo)
Called immediately before a mixin is applied to a target class,
allows any pre-application transformations to be applied.
|
boolean |
shouldApplyMixin(java.lang.String targetClassName,
java.lang.String mixinClassName)
Called during mixin intialisation, allows this plugin to control whether
a specific will be applied to the specified target.
|
void onLoad(java.lang.String mixinPackage)
mixinPackage - The mixin root package from the configjava.lang.String getRefMapperConfig()
null will revert to
the default behaviour of using the default refmap json file.boolean shouldApplyMixin(java.lang.String targetClassName,
java.lang.String mixinClassName)
targetClassName - Fully qualified class name of the target classmixinClassName - Fully qualified class name of the mixinvoid acceptTargets(java.util.Set<java.lang.String> myTargets,
java.util.Set<java.lang.String> otherTargets)
myTargets - Target class set from the companion configotherTargets - Target class set incorporating targets from all other
configs, read-onlyjava.util.List<java.lang.String> getMixins()
void preApply(java.lang.String targetClassName,
org.objectweb.asm.tree.ClassNode targetClass,
java.lang.String mixinClassName,
IMixinInfo mixinInfo)
targetClassName - Transformed name of the target classtargetClass - Target class treemixinClassName - Name of the mixin classmixinInfo - Information about this mixinvoid postApply(java.lang.String targetClassName,
org.objectweb.asm.tree.ClassNode targetClass,
java.lang.String mixinClassName,
IMixinInfo mixinInfo)
targetClassName - Transformed name of the target classtargetClass - Target class treemixinClassName - Name of the mixin classmixinInfo - Information about this mixin