Skip to content
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

Merged
merged 11 commits into from
Jul 9, 2024

Conversation

thecatcore
Copy link
Contributor

@thecatcore thecatcore commented Mar 19, 2024

Loader follow up to FabricMC/fabric-loom#1026, allowing to use the same intermediary format in production as well.

@thecatcore
Copy link
Contributor Author

Tested against modified babric intermediaries and it works flawlessly.

@thecatcore
Copy link
Contributor Author

I've externalized the code defining source namespace to game provider.
I took a different approach to fix the 'hole' issue, I'm creating a new mapping with the source namespace set to remap operation source one. This allows filtering out any missing entry in this namespace.

@thecatcore
Copy link
Contributor Author

thecatcore commented Mar 25, 2024

I'll wait for the next TR release before updating the code accordingly.

Copy link

@halotroop2288 halotroop2288 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve of this PR in concept. Functionally, it looks good to me.

VersionPredicate mergedVersionPredicate = VersionPredicate.parse(">=1.3");

if (!mergedVersionPredicate.test(Version.parse(getNormalizedGameVersion()))) {
sourceNamespace = envType == EnvType.CLIENT ? "clientOfficial" : "serverOfficial";

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

The 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.

@thecatcore
Copy link
Contributor Author

I've updated TR to take advantage of FabricMC/tiny-remapper#128.
Should TinyRemapperMappingsHelper be removed as it is fully replaced by TR TinyUtils?

VersionPredicate mergedVersionPredicate = VersionPredicate.parse(">=1.3");

if (!mergedVersionPredicate.test(Version.parse(getNormalizedGameVersion()))) {
sourceNamespace = envType == EnvType.CLIENT ? "clientOfficial" : "serverOfficial";
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

@SpaceWalkerRS
Copy link
Contributor

Should TinyRemapperMappingsHelper be removed as it is fully replaced by TR TinyUtils?

sounds good

Copy link

@halotroop2288 halotroop2288 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Genius.

@thecatcore
Copy link
Contributor Author

Fixed merge conflicts and fully replaced TinyRemapperMappingsHelper with TR's TinyUtils.

try {
VersionPredicate mergedVersionPredicate = VersionPredicate.parse(">=1.3");

if (!mergedVersionPredicate.test(Version.parse(getNormalizedGameVersion()))) {
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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"?

Copy link
Member

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.

@modmuss50 modmuss50 added this to the 0.16.0 milestone Jul 9, 2024
@modmuss50 modmuss50 changed the title Basic merged intermediary support Support split client/server intermediary for old Minecraft versions Jul 9, 2024
@modmuss50 modmuss50 merged commit fe5b665 into FabricMC:master Jul 9, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants