[Question] Detect if a mixin patch was applied (any)
o/ this is more of a question, maybe a feature request if it makes sense but if not thats fine too.
Basically I have a problem where a mixin might be loaded and I need to alter my code if it is loaded. But I can not make a global modcheck since the code i am applying fixes a bug and how i fix the bug is dependent on if said mixin is loaded.
And sadly if my tooling gets it wrong this will result in a crash.
So is there a way if a mixin was applied to a specific class? Maybe some metadata who patched the class? (that would make the task easier)
It depends on when you need to detect the presence of the mixin, before the classload or after. If it's after classload you can use Mixins::getMixinsForClass, if before then it gets a bit more complicated.
Nah i just need to detect a class when a command is ran and that is done after the class has been loaded for sure (the world has to exist)
But thank you :)
@Mumfrey ok i checked it out, and the example you have given me is actually inverse of what i asked for xD But Reflection should allow me to trace the cache and find it out myself.