Class MixinBootstrap

java.lang.Object
org.spongepowered.asm.launch.MixinBootstrap

public abstract class MixinBootstrap
extends java.lang.Object
Bootstraps the mixin subsystem. This class acts as a bridge between the mixin subsystem and the tweaker or coremod which is boostrapping it. Without this class, a coremod may cause classload of MixinEnvironment in the LaunchClassLoader before we have a chance to exclude it. By placing the main bootstrap logic here we avoid the need for consumers to add the classloader exclusion themselves.

In development, where (because of the classloader environment at dev time) it is safe to let a coremod initialise the mixin subsystem, we can perform initialisation all in one go using the init() method and everything is fine. However in production the tweaker must be used and the situation is a little more delicate.

In an ideal world, the mixin tweaker would initialise the environment in its constructor and that would be the end of the story. However we also need to register the additional tweaker for environment to detect the transition from pre-init to default and we cannot do this within the tweaker constructor without triggering a ConcurrentModificationException in the tweaker list. To work around this we register the secondary tweaker from within the mixin tweaker's acceptOptions method instead.

  • Field Summary

    Fields
    Modifier and Type Field Description
    static java.lang.String VERSION
    Subsystem version
  • Method Summary

    Modifier and Type Method Description
    static void addProxy()
    Deprecated.
    use MixinService.getService().beginPhase() instead
    static MixinPlatformManager getPlatform()
    Get the platform manager
    static void init()
    Initialise the mixin subsystem

    Methods inherited from class java.lang.Object

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

    • VERSION

      public static final java.lang.String VERSION
      Subsystem version
      See Also:
      Constant Field Values
  • Method Details

    • addProxy

      @Deprecated public static void addProxy()
      Deprecated.
      use MixinService.getService().beginPhase() instead
    • getPlatform

      public static MixinPlatformManager getPlatform()
      Get the platform manager
    • init

      public static void init()
      Initialise the mixin subsystem