====== Mixin redirectors ====== ===== introduction ===== Redirectors are methods that can replace method invocations, field accesses, object creation, and ''instanceof'' checks. Redirectors are declared by ''@Redirect'' annotations and generally look like this: @Redirect(method = "${signatureOfMethodInWhichToRedirect}", at = @At(value = "${injectionPointReference}", target = "${signature}")) public ReturnType redirectSomeMethod(Arg0Type arg0, Arg1Type arg1) { MyClass.doMyComputations(); return computeSomethingElse(); } :!: //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: * [[tutorial:mixin_redirectors_methods|redirecting methods]] * [[tutorial:mixin_redirectors_fields|redirecting field access]] * [[tutorial:mixin_redirectors_constructors|redirecting object creation]] * [[tutorial:mixin_redirectors_instanceof|redirecting instanceof checks]]