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:

  1. Implement this interface
  2. Create META-INF/services/com.hypixel.hytale.plugin.early.ClassTransformer containing your implementation class name
  3. Place your JAR in the earlyplugins/ directory
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
     
    byte[]
    transform(String name, String internalName, byte[] classBytes)
    Transforms the bytecode of a class before it is defined.
  • 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 null to skip transformation