Make jarjar use LIBRARY not GAMELIBRARY by default #96
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes the default FMLModType of jarJar-ed deps to be LIBRARY instead of GAMELIBRARY.
Currently, if a language provider wishes to jarJar a non-Minecraft-related library, and use it within the language provider definition itself, the fact that the defaul FMLModType, if the jarJar-ed jar doesn't specify anything, is GAMELIBRARY means that the langauge provider cannot use this. Language providers or other jars loading at that same level - such as GML, a groovy language provider whose implementation is written in groovy - can solve this by JiJing a version of the library with an FMLModType of LIBRARY added to the manifest. This is fine, until a mod JiJs that library or one of its dependencies, of a newer version, and doesn't change the manifest, in which case that version will be loaded and the language provider will fail to find the library. See GroovyMC/GroovyModLoader#23.
A few alternative potential approaches have been considerred to solve this problem:
This solution is comparatively safer than the other solutions, as it only restricts the classpath that JiJed libraries might load on. Furthermore, libraries that are aware of Minecraft or mod code can be expected to declare an FMLModType, while libraries which have nothing to do with modding or MC, and might be needed by language providers or the like, cannot be expected to do so, so it lines up with expectations in that regard. The only cases where this might be expected to cause issues are when a mod is ATing or mixin-ing a dependency that it JiJs, in which case they would be forced into the same situation which language providers are in now. I expect such cases to be comparatively rare, or at any rate substantially rarer than language providers or other things loading at that level wanting to use a library they bundle in their implementation. Furthermore, FML does not allow transformation of the non-mod libraries which Minecraft itself uses - such as brigadier or DFU - in this way anyways, so moving the default FMLModType to match that makes this more consistent.