SpongePowered / Mixin

Mixin is a trait/mixin and bytecode weaving framework for Java using ASM
MIT License
1.44k stars 194 forks source link

MixinToy example repo #236

Open ryantheleach opened 6 years ago

ryantheleach commented 6 years ago

I'd love to get more hands on experience with Mixin in a hands on environment that is tightly controlled, and not going to make a mess of my workspaces. Additionally I think there is some interest in using Mixin outside of Minecraft.

Would it be possible to setup a 'MixinToy' repository that

  1. sets up launchwrapper/transformers to transform classes that run through.
  2. has 2 source sets, the original, and the mixins.
  3. can support obfuscation mappings.

Does anyone have anything like this already set up, that could be cleaned up slightly?

Pokechu22 commented 6 years ago

Not exactly that, but there is https://github.com/SpongePowered/LaunchWrapperTestSuite which might be a good starting point.

mikroskeem commented 6 years ago

You could look into Orion's code, which is pretty much a simple wrapper around Paper Minecraft server. That could be forked into standalone project not targeting Minecraft.

Mumfrey commented 6 years ago

Obviously I'm biased here but personally as a "Mixin playground" I recommend making a simple litemod. 3 files is sufficient to get you running with mixins in a litemod, a build.gradle, a litemod.json and a mixin config json. The reason being that LiteLoader has Mixin directly built in so there's no wiring to speak of, and it loads quickly like a vanilla environment but has modding creature comforts. For context I do 99% of my testing of Mixin itself in a Litemod project.

The LiteLoader Example Mod has a single mixin for demonstration purposes, and shows a minimal setup for working with Mixins in a LiteLoader environment.

If I were to provide a standalone mixin playground, I think the route I would go would be to make an even more barebones version of that example project, since it is in my opinion the best way to get started with experimenting with mixins in minecraft.

I agree that a standalone version would also be cool, it's not actually necessary to use LaunchWrapper to apply Mixins in non-mc projects since it's now possible to stub out a mixin service for this purpose, so I could potentially create a standalone playground project with an example service as well.

DenWav commented 6 years ago

And mcdev will automatically generate a LiteLoader mod project for you too.