Mixin
Mixin copied to clipboard
Fixes crashes caused by reflection loading.
The most popular method to load Mixins in a way that they can modify other mods is to use Dimensional Development's strategy of invoking a few key methods in MixinProcessor via reflection. This is no longer possible since these elements have been removed. This PR adds them back in a deprecated form as a mainstay against an outright crash.
Normally I'd be all for removing these things entirely, but the problem is that this is as far as I can tell the only way to modify other mods in 1.12, meaning that if any mod decides to include 0.8, every other mod that uses this method to load its mixins will cause crashes immediately.
Can and should be fixed on your end, see https://github.com/LoliKingdom/MixinBooter/commit/095a6e0d90c887d4a6b75106199f36629b772e98
Can and should be fixed on your end, see LoliKingdom/MixinBooter@095a6e0
This isn't the only mod that uses this loader. Every mod that implements this itself has this issue, including VanillaFix, every other DimDev mod, and ErebusFix, and most of these mods cannot be changed at this point.
I don't really think old mods being old is a reason to add deprecated compat into Mixin.
I’m not going to speak for Mumfrey, but the real thing that other mods explicitly used reflection on internal non-api classes was already a poor decision to be made on their end. It’s not our responsibility to maintain other people’s workarounds when we already made what API is available and then implementing workarounds that weren’t supported to begin with.
Adding a deprecated annotation doesn’t do anything to explain to a mod developer why it’s not supported.
The reason I made this PR is because the method those mods use was the only way to do it at the time, and while it is obviously outdated now there is also no way to fix the crash this now causes from outside the API. It needs to be considered within the code to fix the crashes.
If backwards compatibility is a consideration when updating the API, then making a small exception for an extremely common method of bootstrapping mixins is par for the course in that regard. I mean, the entirety of Windows is built on that exact principle: that the stupid things programmers used to do need to be considered when designing backwards compatibility. You don't see people moving files to folders to print things anymore, but it won't crash everything if you do, because enough people did it that it needed to be accounted for. If it was popular enough, it needs to be considered, no matter how stupid it was.
Plus it's not like it's a massive change. It's three lines to fix a ton of crashes.