Annotation Interface ModifyReturnValue


@Target(METHOD) @Retention(RUNTIME) public @interface ModifyReturnValue
Allows you to tweak the value being returned from a method.

Your handler method receives the value about to be returned (optionally followed by the enclosing method's parameters), and should return the adjusted value:

 private (static) ReturnType handler(ReturnType original)
 
This chains when used by multiple people, unlike @Inject with getReturnValue and setReturnValue.

If you never use the original then you risk other people's changes being silently ignored.

See the wiki article for more info.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    org.spongepowered.asm.mixin.injection.At[]
     
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    int
     
    int
     
    boolean
     
    int
     
    org.spongepowered.asm.mixin.injection.Slice[]
     
  • Element Details

    • method

      String[] method
    • at

      org.spongepowered.asm.mixin.injection.At[] at
    • slice

      org.spongepowered.asm.mixin.injection.Slice[] slice
      Default:
      {}
    • remap

      boolean remap
      Default:
      true
    • require

      int require
      Default:
      -1
    • expect

      int expect
      Default:
      1
    • allow

      int allow
      Default:
      -1