New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Mixin without Minecraft #46
Comments
You can use Mixin in any application where you control the class loading, for example your own projects or by "wrapping" an existing application. This is possible because Mixin uses LaunchWrapper and other than the "default" support for Minecraft, LaunchWrapper is basically an environment-agnostic extensible ClassLoader system. So yes, other than LaunchWrapper, you can use Mixin without any of the other components like FML or whatever. For obvious reasons you cannot use Mixin with Java EE applications, and obviously using it in a Bukkit plugin is completely impossible. But for standard applications all you need to do is write a Tweaker to plug in to LaunchWrapper and bootstrap your application using Launch. |
How would one initialize Mixins in a standalone project? Would you need to use LegacyWrapper if you weren't using Minecraft? |
Yep, but as I said, LaunchWrapper is entirely application-agnostic and is open source as well, so it's pretty straightforward to use. |
Would I need to make a new Tweaker & TweakerInjector for my application? |
https://github.com/thog/universalat which works on bukkit. |
Just a tweaker is sufficient, the contract of tweakers is pretty straightforward and you can read any of the many examples which are floating around.
Yes but not as a plugin, so that's a stupid example. As I said above, "You can use Mixin in any application where you control the class loading" and this is true of most applications, if you wrap the application then you can do mostly whatever you want. I mean, that's the entire point of LaunchWrapper in the first place! There are ways around this limitation but they're hacky and far from straightforward. |
Build using GHA Drop Java 6 and 7 support Bump to ASM 9 Update gradle New versioning
Hello!
Is there a way to use Mixin without Minecraft, Forge, Sponge, etc? I want to use it in some other projects and initially thought it would be able to be used in a standalone project as the repostitory description suggested: "Mixin is a trait/mixin framework for Java using ASM". I then read further and found out it won
't work for my application in for example a Bukkit Plugin (I am still using it because I am too lazy to move to the SpongeAPI...)
The text was updated successfully, but these errors were encountered: