Package ftbsc.lll.mixin
Class LilleroMixinPlugin
- java.lang.Object
-
- ftbsc.lll.mixin.LilleroMixinPlugin
-
- All Implemented Interfaces:
org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin
public abstract class LilleroMixinPlugin extends java.lang.Object implements org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin
Allows you to load your mod's Lillero patches as a Mixin plugin. Extend this class and specify the child as a plugin in your mod's Mixin config. Refer to your mod loader's instructions for details on how this is done. Methods are left non-final in case you want to alter their behaviour in any way, but I can't really see any merit in doing so.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.logging.log4j.Logger
LOGGER
TheLogger
used by this library.
-
Constructor Summary
Constructors Constructor Description LilleroMixinPlugin(boolean precedence)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acceptTargets(java.util.Set<java.lang.String> myTargets, java.util.Set<java.lang.String> otherTargets)
Does nothing, as we don't need to alter the target class list.protected void
applyLilleroPatches(java.lang.String className, org.objectweb.asm.tree.ClassNode clazz)
Applies the appropriate Lillero patches given a node and a class name.java.util.List<java.lang.String>
getMixins()
This does not apply any additional mixins.java.lang.String
getRefMapperConfig()
Returns null, so it's effectively ignored.void
onLoad(java.lang.String mixinPackage)
Called after the plugin is instantiated, do any setup here.void
postApply(java.lang.String className, org.objectweb.asm.tree.ClassNode clazz, java.lang.String mixinClassName, org.spongepowered.asm.mixin.extensibility.IMixinInfo mixinInfo)
Called immediately after a mixin is applied to a target class.void
preApply(java.lang.String className, org.objectweb.asm.tree.ClassNode clazz, java.lang.String mixinClassName, org.spongepowered.asm.mixin.extensibility.IMixinInfo mixinInfo)
Called immediately before a mixin is applied to a target class.boolean
shouldApplyMixin(java.lang.String targetClassName, java.lang.String mixinClassName)
Tells Mixin to always apply these patches.
-
-
-
Method Detail
-
onLoad
public void onLoad(java.lang.String mixinPackage)
Called after the plugin is instantiated, do any setup here.- Specified by:
onLoad
in interfaceorg.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin
- Parameters:
mixinPackage
- The mixin root package from the config
-
getRefMapperConfig
public java.lang.String getRefMapperConfig()
Returns null, so it's effectively ignored.- Specified by:
getRefMapperConfig
in interfaceorg.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin
- Returns:
- always null
-
shouldApplyMixin
public boolean shouldApplyMixin(java.lang.String targetClassName, java.lang.String mixinClassName)
Tells Mixin to always apply these patches. Lillero doesn't support conditional patches: any check should happen within the patch code itself, with the patch code's scope.- Specified by:
shouldApplyMixin
in interfaceorg.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin
- Parameters:
targetClassName
- fully qualified class name of the target classmixinClassName
- fully qualified class name of the mixin- Returns:
- always true
-
acceptTargets
public void acceptTargets(java.util.Set<java.lang.String> myTargets, java.util.Set<java.lang.String> otherTargets)
Does nothing, as we don't need to alter the target class list.- Specified by:
acceptTargets
in interfaceorg.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin
- Parameters:
myTargets
- target class set from the companion configotherTargets
- target class set incorporating targets from all other configs, read-only
-
getMixins
public java.util.List<java.lang.String> getMixins()
This does not apply any additional mixins.- Specified by:
getMixins
in interfaceorg.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin
- Returns:
- always null
-
preApply
public void preApply(java.lang.String className, org.objectweb.asm.tree.ClassNode clazz, java.lang.String mixinClassName, org.spongepowered.asm.mixin.extensibility.IMixinInfo mixinInfo)
Called immediately before a mixin is applied to a target class. Will apply Lillero patches ifprecedence
is true.- Specified by:
preApply
in interfaceorg.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin
- Parameters:
className
- transformed name of the target classclazz
- target class treemixinClassName
- name of the mixin classmixinInfo
- information about this mixin
-
postApply
public void postApply(java.lang.String className, org.objectweb.asm.tree.ClassNode clazz, java.lang.String mixinClassName, org.spongepowered.asm.mixin.extensibility.IMixinInfo mixinInfo)
Called immediately after a mixin is applied to a target class. Will apply Lillero patches ifprecedence
is false.- Specified by:
postApply
in interfaceorg.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin
- Parameters:
className
- transformed name of the target classclazz
- target class treemixinClassName
- name of the mixin classmixinInfo
- information about this mixin
-
applyLilleroPatches
protected void applyLilleroPatches(java.lang.String className, org.objectweb.asm.tree.ClassNode clazz)
Applies the appropriate Lillero patches given a node and a class name.- Parameters:
className
- the class' fully qualified nameclazz
- the target class
-
-