LlamaLad7 / MixinExtras

Companion library to SpongePowered Mixin with many custom injectors for a more expressive experience.
MIT License
304 stars 17 forks source link

[Suggestion] be able to use 'Object... args' for @WrapOperation #19

Closed KingContaria closed 1 year ago

KingContaria commented 1 year ago

Hi,

sometimes you just want to wrap the method without really worrying about any of the args, in which case just having the method parameters be Object... args, Operation<?> original could be useful. I know that this alone doesnt seem like a big benefit but it can allow for more compatibility between different mc versions (where you may want to wrap the same method but it has different args) by using different this + multiple @At's.

Similar would also be useful for @WrapWithCondition (although in that case just having no args would also do the job, especially if you want to wrap multiple @At's with the same condition.

This isn't something super necessary but could be neat for making mods that work for lots of different versions.

KingContaria commented 1 year ago

actually, the parameters would still be in the @At so it wouldnt actually help compatibility, so i'll close this