Class MixinPluginUtil

java.lang.Object
net.dillon.dillonlib.mixinplugin.MixinPluginUtil
Direct Known Subclasses:
DillonLibMixinPluginUtil

public abstract class MixinPluginUtil extends Object
Simple utility class for IMixinConfigPlugin. You can use this to easily disable mixins on certain conditions with the help of PredicateEntrys

logger - the logger to be used specifically for the mixin plugin. Do not use an outside logger, as you risk Minecraft crashing due to pre-mature load time.

mixinDirectory - the mixin directory to be checked with the plugin. You can have the method return blank or "" if you want to specifically all mixin class names by their full package id. However, it's easier to specify the package id with this method, and then simply input the mixin classes names.

entries - the list of PredicateEntry to check for each mixin loaded at load time. If the predicate entry boolean returns true, the list of mixins in the entry will be disabled at load time.

Since:
1.0
See Also:
  • Constructor Details

    • MixinPluginUtil

      public MixinPluginUtil()
  • Method Details

    • logger

      public abstract org.slf4j.Logger logger()
      Returns:
      the logger for a mixin plugin. It should only be used within the conditional mixin plugin.
    • mixinDirectory

      public abstract String mixinDirectory()
      Returns:
      the mixin directory used to check for mixins.

      Example: "net.dillon.dillonlib.mixin."

    • entries

      public abstract List<PredicateEntry> entries()
      Returns:
      the list of predicates, mixin class names and message reasons for mixins that should be disabled.
    • shouldNotApply

      public boolean shouldNotApply(String targetClassName, String mixinClassName)
      Returns:
      false if mixin should not apply. It is not recommended to override this method, as this provides the full functionality for PredicateEntry.
    • message

      public void message(PredicateEntry entry, String mixinClassName, String targetClassName)
      The message that is sent to the console. This can be over-ridden if you wish to change the message.
    • sendMessage

      public void sendMessage(PredicateEntry entry, String message, Object... arguments)
      Sends a console message to the user, based on the MessageType.