From bba7f773dd32e05f4e29ace93a31f2535f8924c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=ADSollace?= Date: Sun, 19 May 2024 19:37:47 +0100 Subject: [PATCH] Clarify that ModifyArgs.index is the absolute index, not relative If the target method has the argument `(double a, double b, double c, float d, float e)` an index of 1 targets the `double b` argument, not `float e` as one might assume from the second paragraph. --- .../asm/mixin/injection/ModifyArg.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/ModifyArg.java b/src/main/java/org/spongepowered/asm/mixin/injection/ModifyArg.java index 8d5fcc76b..33e9157dd 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/ModifyArg.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/ModifyArg.java @@ -124,14 +124,13 @@ public At at(); /** - *

Gets the argument index on the target to set. It is not necessary to - * set this value if there is only one argument of the modifier type in the - * hooked method's signature. For example if the target method accepts a - * boolean, an integer and a String, and the modifier method accepts and - * returns an integer, then the integer parameter will be automatically - * selected.

+ *

The zero-based, absolute index of the argument to set on the target.

* - *

The index is zero-based.

+ *

It is not necessary to set this value if there is only one argument of + * the modifier type in the hooked method's signature. For example if the target + * method accepts a boolean, an integer and a String, and the modifier method + * accepts and returns an integer, then the integer parameter will be automatically + * selected.

* * @return argument index to modify or -1 for automatic */