From f049d6f20835772fa4f01ec9e2bbc2babf961952 Mon Sep 17 00:00:00 2001 From: 0x189D7997 <199489335+0x189D7997@users.noreply.github.com> Date: Sat, 27 Dec 2025 00:26:41 +0000 Subject: [PATCH 1/9] Fix order in getParentVersionIds --- .../MojangLauncherMetadataProvider.java | 31 +++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java b/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java index d7d78a0b..1c5a7a46 100644 --- a/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java +++ b/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java @@ -266,22 +266,22 @@ protected List getParentVersionIds(String versionId) { return List.of("1.14.3-pre4"); } case "1.14_combat-0" -> { - return List.of("1.14.4", "1.14_combat-212796"); + return List.of("1.14_combat-212796", "1.14.4"); } case "1.14_combat-3" -> { return List.of("1.14_combat-0"); } case "1.15_combat-1" -> { - return List.of("1.15-pre3", "1.14_combat-3"); + return List.of("1.14_combat-3", "1.15-pre3"); } case "1.15_combat-6" -> { - return List.of("1.15.2-pre2", "1.15_combat-1"); + return List.of("1.15_combat-1", "1.15.2-pre2"); } case "1.16_combat-0" -> { - return List.of("1.16.2-pre3", "1.15_combat-6"); + return List.of("1.15_combat-6", "1.16.2-pre3"); } case "1.16_combat-1" -> { - return List.of("1.16.2", "1.16_combat-0"); + return List.of("1.16_combat-0", "1.16.2"); } case "1.16_combat-2" -> { return List.of("1.16_combat-1"); @@ -300,7 +300,7 @@ protected List getParentVersionIds(String versionId) { } // Experimental 1.18 case "1.18_experimental-snapshot-1" -> { - return List.of("1.17.1"); + return List.of("1.17.1-pre1"); } case "1.18_experimental-snapshot-2" -> { return List.of("1.18_experimental-snapshot-1"); @@ -327,9 +327,6 @@ protected List getParentVersionIds(String versionId) { case "1.19_deep_dark_experimental_snapshot-1" -> { return List.of("1.18.1"); } - case "22w11a" -> { - return List.of("1.18.2", "1.19_deep_dark_experimental_snapshot-1"); - } // April case "15w14a" -> { return List.of("1.8.3"); @@ -344,27 +341,23 @@ protected List getParentVersionIds(String versionId) { return List.of("20w13b"); } case "22w13oneblockatatime" -> { - return List.of("22w13a"); - } - case "23w13a_or_b" -> { - return List.of("23w13a_or_b_original", "23w13a"); + return List.of("1.18.2"); } case "23w13a_or_b_original" -> { return List.of("23w13a"); } - case "24w14potato" -> { - return List.of("24w14potato_original", "24w12a"); + case "23w13a_or_b" -> { + return List.of("23w13a_or_b_original"); } case "24w14potato_original" -> { return List.of("24w12a"); } + case "24w14potato" -> { + return List.of("24w14potato_original"); + } case "25w14craftmine" -> { return List.of("1.21.5"); } - // Special case to make version graph not contain a cycle - case "1.9.2" -> { - return List.of("1.9.1"); - } default -> { return null; } From c7e67530fd8e6bed9cf5552194657973b357594c Mon Sep 17 00:00:00 2001 From: 0x189D7997 <199489335+0x189D7997@users.noreply.github.com> Date: Sat, 27 Dec 2025 00:27:58 +0000 Subject: [PATCH 2/9] Exclude 15w14a april fools from mainline --- .../manifest/vanilla/MojangLauncherMetadataProvider.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java b/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java index 1c5a7a46..64b17d3b 100644 --- a/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java +++ b/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java @@ -371,6 +371,8 @@ public boolean shouldExcludeFromMainBranch(OrderedVersion mcVersion) { return super.shouldExcludeFromMainBranch(mcVersion) // filter out april fools snapshots and experimental versions, // which often have typical ids that do not match normal snapshots - || (mcVersion.isSnapshotOrPending() && !NORMAL_SNAPSHOT_PATTERN.matcher(mcVersion.launcherFriendlyVersionName()).matches()); + || (mcVersion.isSnapshotOrPending() && !NORMAL_SNAPSHOT_PATTERN.matcher(mcVersion.launcherFriendlyVersionName()).matches()) + // Exclude april fools that looks like regular snapshot + || Objects.equals(mcVersion.launcherFriendlyVersionName(), "15w14a"); } } From bd85deefadd6ce81efe74fdaa703a5779561fc02 Mon Sep 17 00:00:00 2001 From: 0x189D7997 <199489335+0x189D7997@users.noreply.github.com> Date: Sat, 27 Dec 2025 01:12:51 +0000 Subject: [PATCH 3/9] Fix NORMAL_SNAPSHOT_PATTERN --- .../gitcraft/manifest/skyrising/SkyrisingMetadataProvider.java | 2 +- .../manifest/vanilla/MojangLauncherMetadataProvider.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/com/github/winplay02/gitcraft/manifest/skyrising/SkyrisingMetadataProvider.java b/src/main/groovy/com/github/winplay02/gitcraft/manifest/skyrising/SkyrisingMetadataProvider.java index d10834ea..de34f1d3 100644 --- a/src/main/groovy/com/github/winplay02/gitcraft/manifest/skyrising/SkyrisingMetadataProvider.java +++ b/src/main/groovy/com/github/winplay02/gitcraft/manifest/skyrising/SkyrisingMetadataProvider.java @@ -135,7 +135,7 @@ public List getParentVersions(OrderedVersion mcVersion) { .toList(); } - private static final Pattern NORMAL_SNAPSHOT_PATTERN = Pattern.compile("(^\\d\\dw\\d\\d[a-z](-\\d+)?$)|(^\\d.\\d+(.\\d+)?(-(pre|rc)((-\\d+|\\d+)(-\\d+)?)?|_[a-z_\\-]+snapshot-\\d+| Pre-Release \\d+)?$)"); + private static final Pattern NORMAL_SNAPSHOT_PATTERN = Pattern.compile("(^\\d\\dw\\d\\d[a-z](-\\d+)?$)|(^\\d.\\d+(.\\d+)?(-(pre|rc)((-\\d+|\\d+)(-\\d+)?)?| Pre-Release \\d+)?$)"); @Override public boolean shouldExclude(OrderedVersion mcVersion) { diff --git a/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java b/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java index 64b17d3b..53d77336 100644 --- a/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java +++ b/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java @@ -364,7 +364,7 @@ protected List getParentVersionIds(String versionId) { } } - private static final Pattern NORMAL_SNAPSHOT_PATTERN = Pattern.compile("(^\\d\\dw\\d\\d[a-z]$)|(^\\d.\\d+(.\\d+)?(-(pre|rc)\\d+|_[a-z_\\-]+snapshot-\\d+| Pre-Release \\d+)?$)"); + private static final Pattern NORMAL_SNAPSHOT_PATTERN = Pattern.compile("(^\\d\\dw\\d\\d[a-z]$)|(^\\d.\\d+(.\\d+)?(-(pre|rc)\\d+| Pre-Release \\d+)?$)"); @Override public boolean shouldExcludeFromMainBranch(OrderedVersion mcVersion) { From dcf294a89ee2fbcd39928b6eeb6626f0ae46d92d Mon Sep 17 00:00:00 2001 From: 0x189D7997 <199489335+0x189D7997@users.noreply.github.com> Date: Sun, 28 Dec 2025 22:35:55 +0000 Subject: [PATCH 4/9] Filter out alpha servers from Skyrising parent versions --- .../manifest/skyrising/SkyrisingMetadataProvider.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/groovy/com/github/winplay02/gitcraft/manifest/skyrising/SkyrisingMetadataProvider.java b/src/main/groovy/com/github/winplay02/gitcraft/manifest/skyrising/SkyrisingMetadataProvider.java index de34f1d3..be16d666 100644 --- a/src/main/groovy/com/github/winplay02/gitcraft/manifest/skyrising/SkyrisingMetadataProvider.java +++ b/src/main/groovy/com/github/winplay02/gitcraft/manifest/skyrising/SkyrisingMetadataProvider.java @@ -130,6 +130,7 @@ protected boolean isExistingVersionMetadataValid(SkyrisingManifest.VersionEntry @Override public List getParentVersions(OrderedVersion mcVersion) { return this.getVersionDetails(mcVersion.launcherFriendlyVersionName()).previous().stream() + .filter(it -> !isClassicOrAlphaServer(it)) .map(this::getVersionByVersionID) .filter(Objects::nonNull) .toList(); @@ -137,10 +138,14 @@ public List getParentVersions(OrderedVersion mcVersion) { private static final Pattern NORMAL_SNAPSHOT_PATTERN = Pattern.compile("(^\\d\\dw\\d\\d[a-z](-\\d+)?$)|(^\\d.\\d+(.\\d+)?(-(pre|rc)((-\\d+|\\d+)(-\\d+)?)?| Pre-Release \\d+)?$)"); + private static boolean isClassicOrAlphaServer(String versionId) { + return versionId.startsWith("server-"); + } + @Override public boolean shouldExclude(OrderedVersion mcVersion) { // classic and alpha servers don't work well with the version graph right now - return mcVersion.launcherFriendlyVersionName().startsWith("server-"); + return isClassicOrAlphaServer(mcVersion.launcherFriendlyVersionName()); } @Override From d88c119b83817f493c14ef449cf4b9c4e8a67bda Mon Sep 17 00:00:00 2001 From: 0x189D7997 <199489335+0x189D7997@users.noreply.github.com> Date: Sun, 28 Dec 2025 22:39:57 +0000 Subject: [PATCH 5/9] Fail explicitly if a null parent version is found --- .../manifest/skyrising/SkyrisingMetadataProvider.java | 6 +++++- .../manifest/vanilla/MojangLauncherMetadataProvider.java | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/com/github/winplay02/gitcraft/manifest/skyrising/SkyrisingMetadataProvider.java b/src/main/groovy/com/github/winplay02/gitcraft/manifest/skyrising/SkyrisingMetadataProvider.java index be16d666..aff6cc4f 100644 --- a/src/main/groovy/com/github/winplay02/gitcraft/manifest/skyrising/SkyrisingMetadataProvider.java +++ b/src/main/groovy/com/github/winplay02/gitcraft/manifest/skyrising/SkyrisingMetadataProvider.java @@ -132,7 +132,11 @@ public List getParentVersions(OrderedVersion mcVersion) { return this.getVersionDetails(mcVersion.launcherFriendlyVersionName()).previous().stream() .filter(it -> !isClassicOrAlphaServer(it)) .map(this::getVersionByVersionID) - .filter(Objects::nonNull) + .peek(ver -> { + if (ver == null) { + MiscHelper.panic("One or more of the parent versions were not found for %s", mcVersion.friendlyVersion()); + } + }) .toList(); } diff --git a/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java b/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java index 53d77336..1cbe1716 100644 --- a/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java +++ b/src/main/groovy/com/github/winplay02/gitcraft/manifest/vanilla/MojangLauncherMetadataProvider.java @@ -256,7 +256,14 @@ private String fixupSemver(String proposedSemVer) { @Override public List getParentVersions(OrderedVersion mcVersion) { List parentVersionIds = this.getParentVersionIds(mcVersion.friendlyVersion()); - return parentVersionIds == null ? null : parentVersionIds.stream().map(this::getVersionByVersionID).toList(); + return parentVersionIds == null ? null : parentVersionIds.stream() + .map(this::getVersionByVersionID) + .peek(ver -> { + if (ver == null) { + MiscHelper.panic("One or more of the parent versions were not found for %s", mcVersion.friendlyVersion()); + } + }) + .toList(); } protected List getParentVersionIds(String versionId) { From e7bb92eb09906fc4df679bc7ab3829fd1b590fd9 Mon Sep 17 00:00:00 2001 From: 0x189D7997 <199489335+0x189D7997@users.noreply.github.com> Date: Sun, 28 Dec 2025 23:47:33 +0000 Subject: [PATCH 6/9] Additional types for OrderedVersion --- .../gitcraft/types/OrderedVersion.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/main/groovy/com/github/winplay02/gitcraft/types/OrderedVersion.java b/src/main/groovy/com/github/winplay02/gitcraft/types/OrderedVersion.java index 2193e50d..2e639f4d 100644 --- a/src/main/groovy/com/github/winplay02/gitcraft/types/OrderedVersion.java +++ b/src/main/groovy/com/github/winplay02/gitcraft/types/OrderedVersion.java @@ -112,14 +112,36 @@ public int javaVersion() { return this.versionInfo().javaVersion() != null ? this.versionInfo().javaVersion().majorVersion() : 8; } + // Found in all manifests public boolean isSnapshot() { return Objects.equals(this.versionInfo().type(), "snapshot"); } + // Can be found in Mojang and Skyrising manifests public boolean isPending() { return Objects.equals(this.versionInfo().type(), "pending"); } + // Mojang and Skyrising + public boolean isOldBeta() { + return Objects.equals(this.versionInfo().type(), "old_beta"); + } + + // Mojang and Skyrising + public boolean isOldAlpha() { + return Objects.equals(this.versionInfo().type(), "old_alpha"); + } + + // Skyrising + public boolean isAlphaServer() { + return Objects.equals(this.versionInfo().type(), "alpha_server"); + } + + // Skyrising + public boolean isClassicServer() { + return Objects.equals(this.versionInfo().type(), "classic_server"); + } + public boolean isSnapshotOrPending() { return this.isSnapshot() || this.isPending(); } From ce4d97c3e2fffcd8c69c2c04f38582f273bf153e Mon Sep 17 00:00:00 2001 From: 0x189D7997 <199489335+0x189D7997@users.noreply.github.com> Date: Sun, 28 Dec 2025 23:51:26 +0000 Subject: [PATCH 7/9] Use correct version for tests --- .../com/github/winplay02/gitcraft/GitCraftTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/groovy/com/github/winplay02/gitcraft/GitCraftTest.java b/src/test/groovy/com/github/winplay02/gitcraft/GitCraftTest.java index 6f0c8dd6..e006c3da 100644 --- a/src/test/groovy/com/github/winplay02/gitcraft/GitCraftTest.java +++ b/src/test/groovy/com/github/winplay02/gitcraft/GitCraftTest.java @@ -313,7 +313,7 @@ public void pipeline() throws Exception { } Configuration.reset(); // - GitCraft.main(new String[]{"--only-version=1.17.1,1.18_experimental-snapshot-1,21w37a,1.18,22w13oneblockatatime"}); + GitCraft.main(new String[]{"--only-version=1.17.1-pre1,1.18_experimental-snapshot-1,21w37a,1.18,22w13oneblockatatime"}); try (RepoWrapper repoWrapper = GitCraft.getRepository()) { assertNotNull(repoWrapper); assertNotNull(repoWrapper.getGit().getRepository().getRefDatabase().findRef(GitCraft.getRepositoryConfiguration().gitMainlineLinearBranch())); @@ -323,8 +323,8 @@ public void pipeline() throws Exception { assertEquals(1, Objects.requireNonNull(findCommit(repoWrapper, GitCraft.versionGraph.getMinecraftVersionByName("1.18"))).getParentCount()); assertEquals(2, Objects.requireNonNull(findCommit(repoWrapper, GitCraft.versionGraph.getMinecraftVersionByName("21w37a"))).getParentCount()); assertEquals(1, Objects.requireNonNull(findCommit(repoWrapper, GitCraft.versionGraph.getMinecraftVersionByName("1.18_experimental-snapshot-1"))).getParentCount()); - assertEquals(0, Objects.requireNonNull(findCommit(repoWrapper, GitCraft.versionGraph.getMinecraftVersionByName("1.17.1"))).getParentCount()); - RevCommit targetCommit = Objects.requireNonNull(findCommit(repoWrapper, GitCraft.versionGraph.getMinecraftVersionByName("1.17.1"))); + assertEquals(0, Objects.requireNonNull(findCommit(repoWrapper, GitCraft.versionGraph.getMinecraftVersionByName("1.17.1-pre1"))).getParentCount()); + RevCommit targetCommit = Objects.requireNonNull(findCommit(repoWrapper, GitCraft.versionGraph.getMinecraftVersionByName("1.17.1-pre1"))); try (TreeWalk walk = TreeWalk.forPath(repoWrapper.getGit().getRepository(), "minecraft/resources/assets", targetCommit.getTree())) { // assertNotNull(walk); } @@ -507,7 +507,7 @@ public void pipelineOldSnapshotSkyrisingOrnithe() throws Exception { @Test public void pipelineReset() throws Exception { Configuration.reset(); - GitCraft.main(new String[]{"--only-version=1.17.1,1.18_experimental-snapshot-1,21w37a,1.18,22w13oneblockatatime", "--refresh", "--refresh-min-version=1.18"}); + GitCraft.main(new String[]{"--only-version=1.17.1-pre1,1.18_experimental-snapshot-1,21w37a,1.18,22w13oneblockatatime", "--refresh", "--refresh-min-version=1.18"}); try (RepoWrapper repoWrapper = GitCraft.getRepository()) { assertNotNull(repoWrapper); assertNotNull(repoWrapper.getGit().getRepository().getRefDatabase().findRef(GitCraft.getRepositoryConfiguration().gitMainlineLinearBranch())); @@ -517,8 +517,8 @@ public void pipelineReset() throws Exception { assertEquals(1, Objects.requireNonNull(findCommit(repoWrapper, GitCraft.versionGraph.getMinecraftVersionByName("1.18"))).getParentCount()); assertEquals(2, Objects.requireNonNull(findCommit(repoWrapper, GitCraft.versionGraph.getMinecraftVersionByName("21w37a"))).getParentCount()); assertEquals(1, Objects.requireNonNull(findCommit(repoWrapper, GitCraft.versionGraph.getMinecraftVersionByName("1.18_experimental-snapshot-1"))).getParentCount()); - assertEquals(0, Objects.requireNonNull(findCommit(repoWrapper, GitCraft.versionGraph.getMinecraftVersionByName("1.17.1"))).getParentCount()); - RevCommit targetCommit = Objects.requireNonNull(findCommit(repoWrapper, GitCraft.versionGraph.getMinecraftVersionByName("1.17.1"))); + assertEquals(0, Objects.requireNonNull(findCommit(repoWrapper, GitCraft.versionGraph.getMinecraftVersionByName("1.17.1-pre1"))).getParentCount()); + RevCommit targetCommit = Objects.requireNonNull(findCommit(repoWrapper, GitCraft.versionGraph.getMinecraftVersionByName("1.17.1-pre1"))); try (TreeWalk walk = TreeWalk.forPath(repoWrapper.getGit().getRepository(), "minecraft/resources/assets", targetCommit.getTree())) { // assertNotNull(walk); } From e8fcf920872f7914edf3e599608a58a1a5bce7bf Mon Sep 17 00:00:00 2001 From: 0x189D7997 <199489335+0x189D7997@users.noreply.github.com> Date: Mon, 29 Dec 2025 02:23:19 +0000 Subject: [PATCH 8/9] Fix spacing [no ci] --- .../com/github/winplay02/gitcraft/types/OrderedVersion.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/groovy/com/github/winplay02/gitcraft/types/OrderedVersion.java b/src/main/groovy/com/github/winplay02/gitcraft/types/OrderedVersion.java index 56969351..0d7c2a27 100644 --- a/src/main/groovy/com/github/winplay02/gitcraft/types/OrderedVersion.java +++ b/src/main/groovy/com/github/winplay02/gitcraft/types/OrderedVersion.java @@ -115,7 +115,7 @@ public int javaVersion() { private static final Pattern UNOBFUSCATED_SNAPSHOT_PATTERN = Pattern.compile("^((\\d\\dw\\d\\d[a-z])|(1.\\d+(.\\d+)?-(pre|rc)\\d+))(_unobfuscated|-unobf)$"); - // Found in all manifests + // Found in all manifests public boolean isSnapshot() { return Objects.equals(this.versionInfo().type(), "snapshot") // special case required because the manifest for experimental unobfuscated versions @@ -127,8 +127,8 @@ public boolean isSnapshot() { public boolean isPending() { return Objects.equals(this.versionInfo().type(), "pending"); } - - // Mojang and Skyrising + + // Mojang and Skyrising /** * This method is specifically for checking if this is an experimental "unobfuscated" version. * To determine whether this version has no obfuscation use {@link OrderedVersion#isNotObfuscated()}. From 1887bdace0f3a96bcd15ddf1c8e220f49016e466 Mon Sep 17 00:00:00 2001 From: 0x189D7997 <199489335+0x189D7997@users.noreply.github.com> Date: Mon, 29 Dec 2025 02:30:39 +0000 Subject: [PATCH 9/9] Fix spacing again [no ci] --- .../com/github/winplay02/gitcraft/types/OrderedVersion.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/com/github/winplay02/gitcraft/types/OrderedVersion.java b/src/main/groovy/com/github/winplay02/gitcraft/types/OrderedVersion.java index 0d7c2a27..b8d3fc1d 100644 --- a/src/main/groovy/com/github/winplay02/gitcraft/types/OrderedVersion.java +++ b/src/main/groovy/com/github/winplay02/gitcraft/types/OrderedVersion.java @@ -157,8 +157,8 @@ public boolean isAlphaServer() { // Skyrising public boolean isClassicServer() { return Objects.equals(this.versionInfo().type(), "classic_server"); - } - + } + // Omniarchive public boolean isSpecial() { return Objects.equals(this.versionInfo().type(), "special");