Interface IMixinTransformer
public interface IMixinTransformer
Transformation engine
-
Method Summary
Modifier and TypeMethodDescriptionvoid
audit
(MixinEnvironment environment) Force-load all classes targetted by mixins but not yet appliedboolean
computeFramesForClass
(MixinEnvironment environment, String name, org.objectweb.asm.tree.ClassNode classNode) Called when the transformation reason is computing_frames.byte[]
generateClass
(MixinEnvironment environment, String name) Generate the specified mixin-synthetic classboolean
generateClass
(MixinEnvironment environment, String name, org.objectweb.asm.tree.ClassNode classNode) Get the transformer extensionsUpdate a mixin class with new bytecode.byte[]
transformClass
(MixinEnvironment environment, String name, byte[] classBytes) Apply mixins and postprocessors to the supplied classboolean
transformClass
(MixinEnvironment environment, String name, org.objectweb.asm.tree.ClassNode classNode) Apply mixins and postprocessors to the supplied classbyte[]
transformClassBytes
(String name, String transformedName, byte[] basicClass) Callback from the hotswap agent and LaunchWrapper Proxy, transform class bytecode.
-
Method Details
-
audit
Force-load all classes targetted by mixins but not yet applied- Parameters:
environment
- current environment
-
reload
Update a mixin class with new bytecode.- Parameters:
mixinClass
- Name of the mixinclassNode
- 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 environmentname
- Class transformed nameclassNode
- Class tree- Returns:
- true if the class was transformed
-
transformClassBytes
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 nametransformedName
- Transformed class namebasicClass
- class bytecode- Returns:
- transformed class bytecode
- See Also:
-
transformClass
Apply mixins and postprocessors to the supplied class- Parameters:
environment
- Current environmentname
- Class transformed nameclassBytes
- 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 environmentname
- Class transformed nameclassNode
- Class tree- Returns:
- true if the class was transformed
-
generateClass
Generate the specified mixin-synthetic class- Parameters:
environment
- Current environmentname
- 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 environmentname
- Class transformed nameclassNode
- Empty classnode to populate- Returns:
- True if the class was generated successfully
-
getExtensions
IExtensionRegistry getExtensions()Get the transformer extensions
-