Skip to content

Method Transforms

Tom Martin edited this page Jul 9, 2025 · 1 revision

The two kinds of method transforms work in the same way except:

  • @TransformFromMethod creates a copy and then applies redirects to it
  • @TransformMethod applies redirects directly to the target method

All transforms must be within a class annotated with @Dasm

Example

Copies Vector2's void add(Vector2) onto Vec2d

@Dasm(value = MainSet.class)
public class Vec2d {
    ...
    
    public Vec2d() { ... }
    
    @TransformFromMethod(owner = @Ref(Vector2.class), "add(Lexample/Vector2;)V")
    public native void add(Vec2d vec2d);
}

Clone this wiki locally