-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
Add experimental support for using Mojmap as a runtime #469
base: develop
Are you sure you want to change the base?
Conversation
This PR is ready for review now. It allows selecting Mojmap as the runtime namespace in prod, and it uses RuntimeModRemapper to remap all mods in intermediary to mojmap (It successfully loaded the Cobblemon modpack, but might not be fully reliable). Without the experimental system properties, Loader should behave exactly as before. Some more work will be needed before a hypothetical switch of defaults could occur, at minimum:
In the interest of getting this merged in a reasonable timeframe, the remaining work will be covered in a different PR. |
@@ -285,7 +285,8 @@ private V1ModMetadataImpl readFields(JsonLoaderValue.ObjectImpl root) { | |||
@Nullable | |||
JsonLoaderValue intermediateMappingsValue = quiltLoader.get(QLKeys.INTERMEDIATE_MAPPINGS); | |||
|
|||
String[] supported_mappings = { "org.quiltmc:hashed", "net.fabricmc:intermediary" }; | |||
// TODO: "mojang" for mojmap breaks spec; it is just temporary for now because its experimental | |||
String[] supported_mappings = { "org.quiltmc:hashed", "net.fabricmc:intermediary", "mojang" }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"net.minecraft:mojang"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glitch says this is temporary, but well? I know how permanent placeholders can be like!
Anyway, net.minecraft:mojang
makes sense for dev purposes, but Loom uses net.minecraft:mappings
, which makes sense but is confusing! (what is Minecraft mappings? I've heard of Mojang!)
So, considering this and Mojang's official standards? Maybe we should go with com.mojang:mappings
?
boolean requiresRemap = !location.onClasspath() && QuiltLoader.isDevelopmentEnvironment(); | ||
// a mod needs to be remapped if the mod did not come from the classpath and its mappings do not match | ||
// the current runtime namespace | ||
String mappings = meta.intermediateMappings(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Id use a switch here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is java 8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can switch on strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something I do genuinely wonder about is: what about the mods that uses the remapper thingy? I wouldn't mind breaking compat, but I know that can be tricky; maybe #458 can help?
Anyway, here's the drill:
@@ -309,6 +310,10 @@ private V1ModMetadataImpl readFields(JsonLoaderValue.ObjectImpl root) { | |||
throw new ParseException("Oh no! This version of Quilt Loader doesn't support hashed mappings, please update Quilt Loader to use this mod."); | |||
} | |||
|
|||
if (mappings.equals("mojang") && !QuiltLoader.getMappingResolver().getNamespaces().contains("mojang")) { | |||
throw new ParseException("Oh no! This version of Quilt Loader doesn't support Mojang mappings, please update Quilt Loader to use this mod."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This copy-pastey comment doesn't make sense here compared to the Hashed Mojmap one; how about:
throw new ParseException("Oh no! This version of Quilt Loader doesn't support Mojang mappings, please update Quilt Loader to use this mod."); | |
throw new ParseException("Oh no! This Quilt Loader installation isn't configured to support Mojang mappings."); |
(potential remedies to this are to be determined once uhhhh, we figure out a good way to provide mojmap)
@@ -285,7 +285,8 @@ private V1ModMetadataImpl readFields(JsonLoaderValue.ObjectImpl root) { | |||
@Nullable | |||
JsonLoaderValue intermediateMappingsValue = quiltLoader.get(QLKeys.INTERMEDIATE_MAPPINGS); | |||
|
|||
String[] supported_mappings = { "org.quiltmc:hashed", "net.fabricmc:intermediary" }; | |||
// TODO: "mojang" for mojmap breaks spec; it is just temporary for now because its experimental | |||
String[] supported_mappings = { "org.quiltmc:hashed", "net.fabricmc:intermediary", "mojang" }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glitch says this is temporary, but well? I know how permanent placeholders can be like!
Anyway, net.minecraft:mojang
makes sense for dev purposes, but Loom uses net.minecraft:mappings
, which makes sense but is confusing! (what is Minecraft mappings? I've heard of Mojang!)
So, considering this and Mojang's official standards? Maybe we should go with com.mojang:mappings
?
This expands on @TheGlitch76's initial efforts on running Mojmap as runtime; It works! The log messages are all translated to Mojmap instead of Intermediary! And in theory? Mods that only have code without any use of Mixins and AWs can work!The issue is: the remapper is wonky! It currently hates Mixins and AWs and some results may be partial! So my experiment is y'all's problem now :p(PS: The removal of Tiny v1 support will require Quilt Meta to provide Intermediary v2, which I have tested and can confirm it'll be fine)^ Outdated -- see #469 (comment) below
(glitchhhhhhhh I can't believe you have hijacked this PR into a successful thing!)