Closed magicus closed 1 year ago
It was pointed out to me that using @Local
will solve this particular issue, and it seems to work fine for me.
However, since @Local
is still in beta, users might be reluctant to use it. So I'm leaving this issue open; but feel free to close it. (And feel even freer in bringing @Local
to a fully supported state! ;-))
As mentioned in its docs, WrapOperation does let you get the enclosing method's arguments. As with every other injector you simply add them to the end of your handler parameters. If this is not working for you then feel free to re-open with some more details of exactly what you're trying and what isn't working.
I went back to try to figure out what I was doing which did not work. And of course, now it worked. I think my problem was that I added the additional arguments before the Operation
argument, and not after. PEBKAC, as they say. :)
Sorry for the false bug report, and thank you for a fantastic toolkit for us modders! I cannot for my life understand why this is not part of the Mixin core functionality, but I'm happy at least that you provide it. Thanks!
MixinExtras has been a great improvement to skip all those
@Redirect
in our mod. Thanks for that!However, I just noticed that I have a place where I cannot replace
@Redirect
with@WrapOperation
. Consider the following code:For
@Redirect
, it is possible to get the arguments ofouterMethod
as well, using a signature like this:Unfortunately,
@WrapOperation
does not have this functionality. And since I needed that ItemStack to get my mixin to work, I need to keep the@Redirect
.It would be nice if this use case could be supported by
@WrapOperation
as well.