Contents
Interface ClassTransformer
public interface ClassTransformer
Interface for early plugins that transform class bytecode before classes are loaded.
Discovered via
ServiceLoader from JARs in the earlyplugins/ directory.
To create a class transformer:
- Implement this interface
- Create
META-INF/services/com.hypixel.hytale.plugin.early.ClassTransformercontaining your implementation class name - Place your JAR in the
earlyplugins/directory
-
Method Summary
-
Method Details
-
priority
default int priority()- Returns:
- the priority of the transformer. Higher values run first.
-
transform
@Nullable byte[] transform(@Nonnull String name, @Nonnull String internalName, @Nonnull byte[] classBytes) Transforms the bytecode of a class before it is defined.- Parameters:
name- the binary name of the class (e.g., "com.example.MyClass")internalName- the internal name of the class (e.g., "com/example/MyClass")classBytes- the original bytecode- Returns:
- the transformed bytecode, or
nullto skip transformation
-