FabricMC / fabric-loom

Gradle build system plugin used to automate the setup of a minecraft mod development environment.
MIT License
225 stars 194 forks source link

[Enhancement] Allow changing the merging order of the client and server jars to merge after remapping to intermediary #1016

Closed Flamarine closed 4 months ago

Flamarine commented 7 months ago

Motivation

A very cranky problem while doing legacy modding (for pre-1.2.5 versions) is that the client and server are obfuscated differently, causing the two jars unable to be merged before the merged jar is remapped to intermediary. For upstream Fabric Loom, the method used is evasive: it just does not allow you to do so.

However, the Loom fork by Chocohead (Chocoloom for short) takes a unique approach: it allows you to merge the two jars without conflicts (hopefully) by remapping the two jars separately into intermediaries that are generated with a special tool called Merger along with Matcher, all done before merging. This method itself is tricky, but better than nothing, and having this in upstream Loom would be really useful for legacy modding for not needing to deal with all the side mess.

SpaceWalkerRS commented 6 months ago

This would be great to have. It would be a big step in getting proper merged environment support for pre-1.3 versions (the other big step being to generate all the intermediaries).

modmuss50 commented 6 months ago

I think this is a good idea and within scope, but its going to be lower priority. I havent used "Merger" before, and it does seem a little bit invloved. Its not just as easy as remapping both jars and then adding each class. A first step might be adding an API to loom allowing another plugin to do this?

Right now (upstream) loom does support having seperate sub projects for the client/server.

SpaceWalkerRS commented 6 months ago

To my understanding, Merger is only used to generate the intermediaries. Once you have those, Loom can remap both jars and merge them with Stitch (or whatever tool Loom uses for it). It seems fairly straightforward if Loom just assumes the intermediary jars can be merged 'normally'.

SpaceWalkerRS commented 6 months ago

The biggest change to Loom is then probably to modify the intermediary provider to allow providing different mappings for the client and server jars.

modmuss50 commented 6 months ago

The biggest change to Loom is then probably to modify the intermediary provider to allow providing different mappings for the client and server jars.

If thats all thats needed, then I dont think thats going to be a massive amount of work. 👍

modmuss50 commented 4 months ago

Done!