Interface IMixinTransformer


public interface IMixinTransformer
Transformation engine
  • Method Details

    • audit

      void audit(MixinEnvironment environment)
      Force-load all classes targetted by mixins but not yet applied
      Parameters:
      environment - current environment
    • reload

      List<String> reload(String mixinClass, org.objectweb.asm.tree.ClassNode classNode)
      Update a mixin class with new bytecode.
      Parameters:
      mixinClass - Name of the mixin
      classNode - New bytecode
      Returns:
      List of classes that need to be updated
    • computeFramesForClass

      boolean computeFramesForClass(MixinEnvironment environment, String name, org.objectweb.asm.tree.ClassNode classNode)
      Called when the transformation reason is computing_frames. The only operation we care about here is adding interfaces to target classes but at the moment we don't have sufficient scaffolding to determine that without triggering re-entrance. Currently just a no-op in order to not cause a re-entrance crash under ModLauncher 7.0+.
      Parameters:
      environment - Current environment
      name - Class transformed name
      classNode - Class tree
      Returns:
      true if the class was transformed
    • transformClassBytes

      byte[] transformClassBytes(String name, String transformedName, byte[] basicClass)
      Callback from the hotswap agent and LaunchWrapper Proxy, transform class bytecode. This method delegates to class generation or class transformation based on whether the supplied byte array is null and is therefore suitable for hosts which follow the LaunchWrapper contract.
      Parameters:
      name - Class name
      transformedName - Transformed class name
      basicClass - class bytecode
      Returns:
      transformed class bytecode
      See Also:
    • transformClass

      byte[] transformClass(MixinEnvironment environment, String name, byte[] classBytes)
      Apply mixins and postprocessors to the supplied class
      Parameters:
      environment - Current environment
      name - Class transformed name
      classBytes - Class bytecode
      Returns:
      Transformed bytecode
    • transformClass

      boolean transformClass(MixinEnvironment environment, String name, org.objectweb.asm.tree.ClassNode classNode)
      Apply mixins and postprocessors to the supplied class
      Parameters:
      environment - Current environment
      name - Class transformed name
      classNode - Class tree
      Returns:
      true if the class was transformed
    • generateClass

      byte[] generateClass(MixinEnvironment environment, String name)
      Generate the specified mixin-synthetic class
      Parameters:
      environment - Current environment
      name - Class name to generate
      Returns:
      Generated bytecode or null if no class was generated
    • generateClass

      boolean generateClass(MixinEnvironment environment, String name, org.objectweb.asm.tree.ClassNode classNode)
      Parameters:
      environment - Current environment
      name - Class transformed name
      classNode - Empty classnode to populate
      Returns:
      True if the class was generated successfully
    • getExtensions

      IExtensionRegistry getExtensions()
      Get the transformer extensions