gudASM
A modification that brings a completely new approach to creating Fabric mods - working with bytecode at a low level.
In a nutshell
This tool provides the ability to directly manipulate bytecode and aims to make this process as simple as possible. It is recommended to use it only in cases where standard mixins cannot solve the task at hand.
Capabilities
With gudASM, you get virtually limitless possibilities since you can edit classes at the most fundamental level. The main thing is to carefully monitor which classes you load, and then everything will work stably.
Main features
- Direct class transformation
- Extensive collection of helper methods
- @ForceBootstrap and @ForceInline annotations for situations requiring maximum performance
- Custom entry point
How to get started
Create a class that implements the AsmInitializer
interface and specify it in your mod's configuration file as an entry point:
{
...
"entrypoints": {
"gud_asm": [
"com.example.mod.ILikeBreakingThings"
]
},
...
}
Then implement the AsmInitializer.onInitializeAsm()
method as follows:
package com.example.mod;
import net.gudenau.asm.api.v0.AsmInitializer;
import net.gudenau.asm.api.v0.AsmRegistry;
public class ILikeBreakingThings implements AsmInitializer{
@Override
public void onInitializeAsm(){
AsmRegistry.getInstance().registerTransformer(new AmazingTransformer());
}
}
Further steps are quite intuitive.
Important note: It is not recommended to combine the use of AsmInitializer
with other initializers, as this may lead to unstable operation and crashes.