Alvinn8 / paper-nms-maven-plugin

A maven plugin for using NMS on paper with Mojang mappings.
MIT License
115 stars 8 forks source link

Add MixinExtension #12

Closed tonbei closed 1 year ago

tonbei commented 1 year ago

Sorry if this is hard to read as I am using DeepL translation.

This pull request will generate a Mojang mapping (.srg) and extend the scope of the remapping to Mixin annotations. If it is only an extension, just add .extension(new MixinExtension()) to TinyRemapper. However, in order for the remapping to be applied, Mixin must be compiled with the remap flag enabled, and the mapping file (.srg) must be loaded into Mixin. Since the dev-bundle contains only what needs to be remapped, it is not appropriate to load it into Mixin due to the lack of methods and fields. For this reason, we generate Mojang mappings even when using the dev-bundle.

Example of remapping:

@Inject(at = {@At("RETURN")}, method = {"tick()V"})
@Inject(at = {@At("RETURN")}, method = {"k()V"})

Example of pom.xml: https://github.com/tonbei/PaperShelledPluginMavenTemplate/blob/master/pom.xml

Alvinn8 commented 1 year ago

Hello, thanks for the PR. I'm a bit busy right now so I will take a look at this at a later date.

Alvinn8 commented 1 year ago

Sorry for the delay! While Paper doesn't support Mixins, I do understand that if using Mixins, using Mojang mappings would be desirable. I'm unsure if it's in the scope of this project though. Maybe a config option to enable this? I also don't 100% like always creating mappings manually. I don't really understand why it's necessary to merge the mappings manually instead of using the one from the dev bundle. Could you clarify that?