-
Notifications
You must be signed in to change notification settings - Fork 269
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
Support split client/server intermediary for old Minecraft versions #912
Changes from 8 commits
22eb1d8
a53ab60
512807e
d674dde
4874164
860046c
5ace420
c83ca81
830e3cd
3c2e135
e1fac9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,8 +35,10 @@ | |
|
||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.loader.api.ObjectShare; | ||
import net.fabricmc.loader.api.Version; | ||
import net.fabricmc.loader.api.VersionParsingException; | ||
import net.fabricmc.loader.api.metadata.ModDependency; | ||
import net.fabricmc.loader.api.metadata.version.VersionPredicate; | ||
import net.fabricmc.loader.impl.FabricLoaderImpl; | ||
import net.fabricmc.loader.impl.FormattedException; | ||
import net.fabricmc.loader.impl.game.GameProvider; | ||
|
@@ -318,10 +320,22 @@ public void initialize(FabricLauncher launcher) { | |
obfJars.put("realms", realmsJar); | ||
} | ||
|
||
String sourceNamespace = "official"; | ||
|
||
try { | ||
VersionPredicate mergedVersionPredicate = VersionPredicate.parse(">=1.3"); | ||
|
||
if (!mergedVersionPredicate.test(Version.parse(getNormalizedGameVersion()))) { | ||
sourceNamespace = envType == EnvType.CLIENT ? "clientOfficial" : "serverOfficial"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Leaving a comment, as requested by @thecatcore) Treating an enum value as a boolean feels wrong, even if it will always realistically be one or the other. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think in this case it's fine, even if strictly something like a switch statement would be better. I don't see that enum getting another value. |
||
} | ||
} catch (VersionParsingException ignored) { | ||
Log.warn(LogCategory.GAME_PROVIDER, "Failed to determine source namespace for remapping, defaulting to 'official'..."); | ||
} | ||
|
||
obfJars = GameProviderHelper.deobfuscate(obfJars, | ||
getGameId(), getNormalizedGameVersion(), | ||
getLaunchDirectory(), | ||
launcher); | ||
launcher, sourceNamespace); | ||
|
||
for (int i = 0; i < gameJars.size(); i++) { | ||
Path newJar = obfJars.get(names[i]); | ||
|
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.
Could this be a system property to enable (or disable?)? You should still be able to easily set when installing loader.
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.
Do you mean a system property for "merged intermediaries" or for the source namespace?
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.
I think its important for there to still be a way to still be able to use the previous "merged" intermediaries on these older versions. Another option could be to just check what source namespaces are present in the current mapping set.
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.
what should be the default then? previous or new "merged"?
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 could probably just check the namespaces, if it has
official
then use that, if not use one of the others. Removes the need for the version comparision as well.