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
    Constructor
    Description
    Create a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    acceptTargets(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.
    void
    onLoad(String mixinPackage)
    Initialize the plugin.
    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.
    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.
    boolean
    shouldApplyMixin(String targetClassName, String mixinClassName)
    Check if a mixin should be applied.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MixinConfigPlugin

      public MixinConfigPlugin()
      Create a new instance.
  • Method Details

    • onLoad

      public void onLoad(String mixinPackage)
      Initialize the plugin.
      Specified by:
      onLoad in interface org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin
      Parameters:
      mixinPackage - The package root for mixins from the mixin configuration.
    • getRefMapperConfig

      public String getRefMapperConfig()
      Get the reference map if one was not supplied.
      Specified by:
      getRefMapperConfig in interface org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin
      Returns:
      The reference map to use or null to fall back to default behaviour.
    • shouldApplyMixin

      public boolean shouldApplyMixin(String targetClassName, String mixinClassName)
      Check if a mixin should be applied.
      Specified by:
      shouldApplyMixin in interface org.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:
      true if the mixin should be applied; false otherwise.
    • acceptTargets

      public void acceptTargets(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.
      Specified by:
      acceptTargets in interface org.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

      public List<String> getMixins()
      Get a list of mixins to append to the list of mixins loaded from the configuration.
      Specified by:
      getMixins in interface org.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:
      preApply in interface org.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:
      postApply in interface org.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.