CleanroomMC / MixinBooter

Allows any mixins that work on mods to work effortlessly. With a single class and an annotation. On 1.12.2.
GNU Lesser General Public License v2.1
50 stars 17 forks source link

[Question] How to mixin into `ReflectionHelper` #40

Closed SettingDust closed 1 year ago

SettingDust commented 1 year ago

I wanna to add a public static method(backport) for compatibility with mod that need it. I'm trying to create private static method and transform the at post apply in mixin plugin. That's will work I've made mixin exports true. But the NoSuchMethod is throwed before the ReflectionHelper exporting. Is method check before load class completing? Am I have to load the class by my self? And then, I tried load the class with new, ::class, Class.forName. But nothing happened. How can I make my mixin apply?

https://gist.github.com/SettingDust/ae46a38645514afba161417d254eceb9

Mixin config loaded

[16:56:24] [main/INFO] [MixinBooter]: Adding liangmu_fixes.mixins.json mixin configuration.
[16:56:24] [main/INFO] [mixin]: Selecting config liangmu_fixes.mixins.json
[16:56:25] [main/WARN] [mixin]: Reference map 'liangmu_fixes.refmap.json' for liangmu_fixes.mixins.json could not be read. If this is a development environment you can ignore this message
[16:56:25] [main/INFO] [mixin]: Preparing liangmu_fixes.mixins.json (1)
SettingDust commented 1 year ago

The same mixin into ObfuscationReflectionHelper is applied. Have no idea now XD Maybe the early loader is still too late

KorewaLidesu commented 1 year ago

The same mixin into ObfuscationReflectionHelper is applied. Have no idea now XD Maybe the early loader is still too late

what stuff are you try to archive here?

SettingDust commented 1 year ago

what stuff are you try to archive here?

Add static method from newer forge. So that compat with a mod. I'm mixin the usage class for now

Rongmario commented 1 year ago

It is not advisable to use mixins for such a purpose. Is there a reason why you are using an older Forge version?

SettingDust commented 1 year ago

It is not advisable to use mixins for such a purpose. Is there a reason why you are using an older Forge version?

The client forge version can't be changed. Maybe the package relauncher is too early. Close for no way