Class MixinConfigPlugin
java.lang.Object
com.glektarssza.expandedgamerules.MixinConfigPlugin
- All Implemented Interfaces:
org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin
public class MixinConfigPlugin
extends Object
implements org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptTargets(Set<String> myMixinTargets, Set<String> otherMixinTargets) Called after all mixin configurations are initialized to allow this mod to decide whether to abort applying any mixins.Get a list of mixins to append to the list of mixins loaded from the configuration.Get the reference map if one was not supplied.voidInitialize the plugin.voidpostApply(String targetClassName, org.objectweb.asm.tree.ClassNode targetClass, String mixinClassName, org.spongepowered.asm.mixin.extensibility.IMixinInfo mixinInfo) Called immediately after a mixin is applied.voidpreApply(String targetClassName, org.objectweb.asm.tree.ClassNode targetClass, String mixinClassName, org.spongepowered.asm.mixin.extensibility.IMixinInfo mixinInfo) Called immediately before a mixin is applied.booleanshouldApplyMixin(String targetClassName, String mixinClassName) Check if a mixin should be applied.
-
Constructor Details
-
MixinConfigPlugin
public MixinConfigPlugin()Create a new instance.
-
-
Method Details
-
onLoad
Initialize the plugin.- Specified by:
onLoadin interfaceorg.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin- Parameters:
mixinPackage- The package root for mixins from the mixin configuration.
-
getRefMapperConfig
Get the reference map if one was not supplied.- Specified by:
getRefMapperConfigin interfaceorg.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin- Returns:
- The reference map to use or
nullto fall back to default behaviour.
-
shouldApplyMixin
Check if a mixin should be applied.- Specified by:
shouldApplyMixinin interfaceorg.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin- Parameters:
targetClassName- The name of the class being targeted by them mixin.mixinClassName- The name of the class containing the mixin.- Returns:
trueif the mixin should be applied;falseotherwise.
-
acceptTargets
Called after all mixin configurations are initialized to allow this mod to decide whether to abort applying any mixins.- Specified by:
acceptTargetsin interfaceorg.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin- Parameters:
myMixinTargets- The set of mixins which are slated to be applied by this mixin configuration. Removing items from this set will abort applying them. Adding to this set does nothing.otherMixinTargets- A set of mixins which are slated to by applied by other mixin configurations. This set is read-only.
-
getMixins
Get a list of mixins to append to the list of mixins loaded from the configuration.- Specified by:
getMixinsin interfaceorg.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin- Returns:
- A list of mixins to append to the existing list of mixins to be applied.
-
preApply
public void preApply(String targetClassName, org.objectweb.asm.tree.ClassNode targetClass, String mixinClassName, org.spongepowered.asm.mixin.extensibility.IMixinInfo mixinInfo) Called immediately before a mixin is applied.- Specified by:
preApplyin interfaceorg.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin- Parameters:
targetClassName- The name of the class that will be transformed.targetClass- The class which will be transformed.mixinClassName- The class which contained the mixin which will be applied.mixinInfo- The information about the mixin which will be applied.
-
postApply
public void postApply(String targetClassName, org.objectweb.asm.tree.ClassNode targetClass, String mixinClassName, org.spongepowered.asm.mixin.extensibility.IMixinInfo mixinInfo) Called immediately after a mixin is applied.- Specified by:
postApplyin interfaceorg.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin- Parameters:
targetClassName- The name of the class that was transformed.targetClass- The class which was transformed.mixinClassName- The class which contained the mixin applied.mixinInfo- The information about the mixin applied.
-