User Tools

Site Tools


tutorial:mixin_redirectors

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorial:mixin_redirectors [2020/08/17 01:10] – fix page user11681tutorial:mixin_redirectors [2025/09/22 22:21] (current) – Add warning about redirectors being unable to chain, link to information about MixinExtras. gauntrecluse
Line 7: Line 7:
 @Redirect(method = "${signatureOfMethodInWhichToRedirect}", @Redirect(method = "${signatureOfMethodInWhichToRedirect}",
           at = @At(value = "${injectionPointReference}", target = "${signature}"))           at = @At(value = "${injectionPointReference}", target = "${signature}"))
-public ReturnType redirectSomeMethod(Arg0Typearg0, Arg1Type arg1) {+public ReturnType redirectSomeMethod(Arg0Type arg0, Arg1Type arg1) {
     MyClass.doMyComputations();     MyClass.doMyComputations();
      
Line 13: Line 13:
 } }
 </code> </code>
 +
 +:!: //Redirectors of all kinds work by redirecting the target to your handler method. This causes a hard incompatibility if another mod tries to redirect the same target as this makes it impossible to chain or nest redirects. This makes @WrapOperation and @ModifyExpressionValue from MixinExtras preferable for all use-cases where the developer does not directly intend for an incompatibility. You can find more information about those alternatives on the [[https://github.com/LlamaLad7/MixinExtras/wiki|Official MixinExtras Wiki]].//
  
 Refer to the specific redirection tutorials for information about injection point references: Refer to the specific redirection tutorials for information about injection point references:
tutorial/mixin_redirectors.1597626619.txt.gz · Last modified: 2020/08/17 01:10 by user11681