Class Mixins

java.lang.Object
org.spongepowered.asm.mixin.Mixins

public final class Mixins extends Object
Entry point for registering global mixin resources. Compatibility with pre-0.6 versions is maintained via the methods on MixinEnvironment delegating to the methods here.
  • Method Details

    • addConfigurations

      public static void addConfigurations(String... configFiles)
      Add multiple configurations
      Parameters:
      configFiles - config resources to add
    • addConfigurations

      public static void addConfigurations(String[] configFiles, IMixinConfigSource source)
      Add multiple configurations
      Parameters:
      configFiles - config resources to add
      source - source of the configuration resource
    • addConfiguration

      public static void addConfiguration(String configFile)
      Add a mixin configuration resource
      Parameters:
      configFile - path to configuration resource
    • addConfiguration

      public static void addConfiguration(String configFile, IMixinConfigSource source)
      Add a mixin configuration resource
      Parameters:
      configFile - path to configuration resource
      source - source of the configuration resource
    • getUnvisitedCount

      public static int getUnvisitedCount()
      Get the number of pending configurations waiting to be consumed by a selection pass.

      CLEANROOM: Note, as of 0.2.0, phases are being removed: configs are queued in the pending set as they are registered and consumed unconditionally on the next select pass (a selected config is removed from the set). The set's size therefore is the count of configs not yet consumed. The old per-config "visited" flag was only meaningful while environment mismatched configs lingered in the set, which can no longer happen.

      Returns:
      pending (unconsumed) config count
    • getConfigs

      public static Set<Config> getConfigs()
      Get current pending configs set, only configs which have yet to be consumed are present in this set
    • getConfigsByOwner

      public static Set<Config> getConfigsByOwner(String ownerId)
      Get all known configs owned by the mod with the supplied id, matched against each config's clean source id. The host (e.g. MixinBooter or the Cleanroom Loader) is responsible for ensuring a config's source id mirrors its owner id.
      Parameters:
      ownerId - owner id to search for, this would be a mod id if running in modded contexts
      Returns:
      configs owned by the specified owner (never null, may be empty)
    • getMixinsForClass

      public static Set<IMixinInfo> getMixinsForClass(String className)
      Get information about mixins applied to the specified class in the current session.
      Parameters:
      className - Name of class to retrieve mixins for
      Returns:
      Set of applied mixins
    • registerErrorHandlerClass

      public static void registerErrorHandlerClass(String handlerName)
      Register a gloabl error handler class
      Parameters:
      handlerName - Fully qualified class name
    • getErrorHandlerClasses

      public static Set<String> getErrorHandlerClasses()
      Get current error handlers