Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5cab75d
Filter null values from parent versions list
0x189D7997 Oct 15, 2025
33be7d3
Fix breaking typo
0x189D7997 Oct 16, 2025
329b891
Add parent version overrides for Omniarchive manifest
0x189D7997 Oct 16, 2025
708af6e
Add more special cases for parent versions
0x189D7997 Oct 16, 2025
f6c9b35
Replace null filter with assertion
0x189D7997 Oct 17, 2025
27c36af
Filter classic and alpha server from Skyrining parent versions
0x189D7997 Oct 17, 2025
c2836df
fix typos
0x189D7997 Oct 17, 2025
1795749
Exclude 15w14a from main branch as an april fools snapshot
0x189D7997 Oct 23, 2025
d98d8ce
Make 22w13oneblockatatime use correct parent version
0x189D7997 Oct 23, 2025
f458872
Add ability to override NORMAL_SNAPSHOT_PATTERN in MojangLauncherMeta…
0x189D7997 Oct 23, 2025
5044a72
Add detection for more version types from different manifests
0x189D7997 Oct 28, 2025
60bf6cb
Use custom shouldExcludeFromMainBranch for Omniarchive manifest
0x189D7997 Oct 28, 2025
ff0f1f7
fix missing imports and a typo
0x189D7997 Oct 30, 2025
9178d85
Propagate root paramter when recursively calling walkBackToBranchPoint
0x189D7997 Nov 15, 2025
439b844
Place 1.18 and deep dark experimental snapshots correctly
0x189D7997 Nov 16, 2025
8a4a969
Correct branch structure for 23w13a_or_b and 24w14potato
0x189D7997 Nov 17, 2025
0565329
Remove redundant special case
0x189D7997 Nov 17, 2025
60cef6b
Improve combat branch structure representation in code
0x189D7997 Nov 17, 2025
d31a0bf
Repeat changes for Omniarchive manifest
0x189D7997 Nov 17, 2025
791a28e
Do not include experimantal snapshots in NORMAL_SNAPSHOT_PATTERN
0x189D7997 Nov 17, 2025
e94cd8a
Use correct versions for pipeline tests
0x189D7997 Nov 20, 2025
e0bfb8e
Omniarchive: Find duplicate 'launcher' versions automatically
0x189D7997 Nov 20, 2025
80ed2c3
Fix incorrect removal of launcher suffix
0x189D7997 Nov 20, 2025
d16b775
Fix for '2.0-preview' april fools version
0x189D7997 Nov 20, 2025
d3f2896
Merge branch 'master' into fix-null-parent-versions
0x189D7997 Dec 3, 2025
45cd457
Use getVersionsAssumeLoaded from #46
0x189D7997 Dec 18, 2025
c39a34a
Mark Omniarchive special snapshots as such
0x189D7997 Dec 20, 2025
f44e6b8
Merge branch 'master' into fix-null-parent-versions
0x189D7997 Dec 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import java.time.ZonedDateTime;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class GitCraftQuirks {
/// Mapping quirks
Expand Down Expand Up @@ -54,4 +56,8 @@ public class GitCraftQuirks {

// There are no releases for these parchment versions (yet)
public static List<String> parchmentMissingVersions = List.of("1.18", "1.19", "1.19.1", "1.20", "1.20.5", "1.21.2");

// Special cases for Omniarchive manifest
public static List<String> omniarchiveSpecialSnapshots = List.of("1.0.0-tominecon", "13w02a-whitetexturefix", "13w04a-whitelinefix", "1.5-pre-whitelinefix", "13w12~-1439");
public static List<String> omniarchiveLinearSpecials = Stream.concat(Stream.of("c0.0.11a-launcher", "c0.0.13a-launcher", "b1.6-tb3"), omniarchiveSpecialSnapshots.stream()).collect(Collectors.toList());
}
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ private OrderedVersion walkBackToBranchPoint(OrderedVersion mcVersion, boolean r
Set<OrderedVersion> branches = this.getPreviousVertices(mcVersion);

if (branches.size() == 1) {
return this.walkBackToBranchPoint(branches.iterator().next());
return this.walkBackToBranchPoint(branches.iterator().next(), root);
}

// version is not a branch point or root, and number of prev versions
Expand All @@ -342,7 +342,7 @@ private OrderedVersion walkBackToBranchPoint(OrderedVersion mcVersion, boolean r
// if path length to tip is not present, then this version
// was already marked as lying on a branch
if (!this.pathsToTip.containsKey(branch)) {
return this.walkBackToBranchPoint(branch);
return this.walkBackToBranchPoint(branch, root);
}

int pathToRoot = this.pathsToRoot.get(branch);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package com.github.winplay02.gitcraft.manifest.omniarchive;

import java.util.List;
import java.util.regex.Pattern;

import com.github.winplay02.gitcraft.GitCraftQuirks;
import com.github.winplay02.gitcraft.manifest.ManifestSource;
import com.github.winplay02.gitcraft.manifest.vanilla.MojangLauncherMetadataProvider;
import com.github.winplay02.gitcraft.types.OrderedVersion;

public class OmniarchiveMetadataProvider extends MojangLauncherMetadataProvider {

Expand All @@ -29,11 +32,150 @@ public String getInternalName() {
@Override
public List<String> getParentVersionIds(String versionId) {
switch (versionId) {
case "3D Shareware v1.34" -> {
return List.of("19w13b+1653");
// Combat
case "combat1" -> {
return List.of("1.14.3-pre4");
}
case "combat2" -> {
return List.of("combat1", "1.14.4");
}
case "combat3" -> {
return List.of("combat2");
}
case "combat4" -> {
return List.of("combat3", "1.15-pre3");
}
case "combat5" -> {
return List.of("combat4", "1.15.2-pre2");
}
case "combat6" -> {
return List.of("combat5", "1.16.2-pre3");
}
case "combat7" -> {
return List.of("combat6", "1.16.2");
}
case "combat7b" -> {
return List.of("combat7");
}
case "combat7c" -> {
return List.of("combat7b");
}
case "combat8" -> {
return List.of("combat7c");
}
case "combat8b" -> {
return List.of("combat8");
}
case "combat8c" -> {
return List.of("combat8b");
}
// Experimental 1.18
case "1.18-exp1" -> {
return List.of("1.17.1-pre1");
}
case "1.18-exp2" -> {
return List.of("1.18-exp1");
}
case "1.18-exp3" -> {
return List.of("1.18-exp2");
}
case "1.18-exp4" -> {
return List.of("1.18-exp3");
}
case "1.18-exp5" -> {
return List.of("1.18-exp4");
}
case "1.18-exp6" -> {
return List.of("1.18-exp5");
}
case "1.18-exp7" -> {
return List.of("1.18-exp6");
}
case "21w37a" -> {
return List.of("1.17.1", "1.18-exp7");
}
// Experimental 1.19
case "1.19-exp1" -> {
return List.of("1.18.1");
}
// April
case "2.0-preview" -> {
return List.of("1.5.1");
}
case "2.0-blue" -> {
return List.of("1.5.1");
}
case "2.0-purple" -> {
return List.of("1.5.1");
}
case "2.0-red" -> {
return List.of("1.5.1");
}
case "3D Shareware v1.34" -> {
return List.of("19w13b-1653");
}
case "23w13a_or_b-0722" -> {
return List.of("23w13a");
}
case "23w13a_or_b-1249" -> {
return List.of("23w13a_or_b-0722");
}
case "24w14potato-0838" -> {
return List.of("24w12a");
}
case "24w14potato-1104" -> {
return List.of("24w14potato-0838");
}
//Beta
case "b1.3-demo" -> {
return List.of("b1.3_01");
}
case "b1.2_02-dev" -> {
return List.of("b1.2_02");
}
//Classic
case "c0.30-c-1900-renew" -> {
return List.of("c0.30-c-1900");
}
}

String launcher_duplicate = this.getLauncherVersionDuplicate(versionId);
if (launcher_duplicate != null) {
return List.of(launcher_duplicate);
}

return super.getParentVersionIds(versionId);
}

private static final Pattern OMNI_NORMAL_SNAPSHOT_PATTERN = Pattern.compile("(^\\d\\dw\\d\\d[a-z](-\\d+)?$)|(^\\d.\\d+(.\\d+)?(-(pre|rc)(\\d+)?(-\\d+)?)?$)");

@Override
protected Pattern getNormalSnapshotPattern() {
return OMNI_NORMAL_SNAPSHOT_PATTERN;
}

private static final String LAUNCHER_SUFFIX = "-launcher";

private String getLauncherVersionDuplicate(String versionId) {
if (versionId.endsWith(LAUNCHER_SUFFIX)) {
String potential_duplicate = versionId.substring(0, versionId.length() - LAUNCHER_SUFFIX.length());
if (this.getVersionsAssumeLoaded().containsKey(potential_duplicate)) {
return potential_duplicate;
}
}
return null;
}

@Override
public boolean shouldExcludeFromMainBranch(OrderedVersion mcVersion) {
return super.shouldExcludeFromMainBranch(mcVersion)
// Exclude all april fools snapshots
|| mcVersion.isAprilFools()
// Exclude special versions such as combat experiments and b1.3-demo
|| (mcVersion.isSpecial()
// Allow special versions which do not branch out
&& !GitCraftQuirks.omniarchiveLinearSpecials.contains(mcVersion.launcherFriendlyVersionName()))
// Exclude duplicate versions from launcher
|| (this.getLauncherVersionDuplicate(mcVersion.launcherFriendlyVersionName()) != null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,26 @@ protected boolean isExistingVersionMetadataValid(SkyrisingManifest.VersionEntry
@Override
public List<OrderedVersion> 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();
}

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) {
// classic and alpha servers don't work well with the version graph right now
return mcVersion.launcherFriendlyVersionName().startsWith("server-");
return isClassicOrAlphaServer(mcVersion.launcherFriendlyVersionName());
}

private static boolean isClassicOrAlphaServer(String versionId) {
return versionId.startsWith("server-");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ protected boolean isExistingVersionMetadataValid(MojangLauncherManifest.VersionE

// Version Override
private static final Map<String, String> minecraftVersionSemVerOverride = Map.of(
// present in Omniarchive manifest and fabric-loader does not parse it correctly
"2.0-preview", "2.0-preview"
// FIX until fabric-loader is updated
// END FIX
);
Expand Down Expand Up @@ -256,7 +258,14 @@ private String fixupSemver(String proposedSemVer) {
@Override
public List<OrderedVersion> getParentVersions(OrderedVersion mcVersion) {
List<String> 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<String> getParentVersionIds(String versionId) {
Expand All @@ -266,22 +275,22 @@ protected List<String> 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");
Expand All @@ -300,7 +309,7 @@ protected List<String> 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");
Expand All @@ -327,9 +336,6 @@ protected List<String> 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");
Expand All @@ -344,40 +350,43 @@ protected List<String> 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;
}
}
}

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+)?$)");

protected Pattern getNormalSnapshotPattern() {
return NORMAL_SNAPSHOT_PATTERN;
}

@Override
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()
&& !this.getNormalSnapshotPattern().matcher(mcVersion.launcherFriendlyVersionName()).matches())
// Exclude april fools that looks like regular snapshot
|| Objects.equals(mcVersion.launcherFriendlyVersionName(), "15w14a");
}
}
Loading