Skip to content

Commit

Permalink
auto select jar configuration based on which sides are present
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceWalkerRS committed Sep 30, 2024
1 parent 4f69924 commit d6d3d54
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,16 @@ private synchronized void setupMinecraft(ConfigContext configContext) throws Exc

var jarConfiguration = extension.getMinecraftJarConfiguration().get();

if (jarConfiguration == MinecraftJarConfiguration.MERGED && !metadataProvider.getVersionMeta().isVersionOrNewer(Constants.RELEASE_TIME_1_3)) {
jarConfiguration = MinecraftJarConfiguration.LEGACY_MERGED;
if (jarConfiguration == MinecraftJarConfiguration.MERGED) {
// if no configuration is selected by the user, attempt to select one
// based on the mc version and which sides are present for it
if (!metadataProvider.getVersionMeta().downloads().containsKey("server")) {
jarConfiguration = MinecraftJarConfiguration.CLIENT_ONLY;
} else if (!metadataProvider.getVersionMeta().downloads().containsKey("client")) {
jarConfiguration = MinecraftJarConfiguration.SERVER_ONLY;
} else if (!metadataProvider.getVersionMeta().isVersionOrNewer(Constants.RELEASE_TIME_1_3)) {
jarConfiguration = MinecraftJarConfiguration.LEGACY_MERGED;
}
}

// Provide the vanilla mc jars
Expand Down

0 comments on commit d6d3d54

Please sign in to comment.