Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/daedalus-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull Docker image from GHCR
run: docker pull ghcr.io/modrinth/daedalus:main
run: docker pull ghcr.io/modrinth/daedalus:fetch-fix-daedalus

- name: Run Docker container
env:
Expand All @@ -48,4 +48,4 @@ jobs:
-e CLOUDFLARE_INTEGRATION=$CLOUDFLARE_INTEGRATION \
-e CLOUDFLARE_TOKEN=$CLOUDFLARE_TOKEN \
-e CLOUDFLARE_ZONE_ID=$CLOUDFLARE_ZONE_ID \
ghcr.io/modrinth/daedalus:main
ghcr.io/modrinth/daedalus:fetch-fix-daedalus
2 changes: 2 additions & 0 deletions apps/daedalus_client/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ pub enum ErrorKind {
Tracing(#[from] tracing::subscriber::SetGlobalDefaultError),
#[error("Zip error: {0}")]
Zip(#[from] async_zip::error::ZipError),
#[error("Failed to parse an integer: {0}")]
ParseIntError(#[from] std::num::ParseIntError),
}

#[derive(Debug)]
Expand Down
36 changes: 28 additions & 8 deletions apps/daedalus_client/src/forge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,41 @@ pub async fn fetch_neo(
}).chain(neo_versions.versioning.versions.version.into_iter().map(|loader_version| {
let mut parts = loader_version.split('.');

// NeoForge Forge versions are in this format: 20.2.29-beta, 20.6.119
// Where the first number is the major MC version, the second is the minor MC version, and the third is the NeoForge version
let major = parts.next().ok_or_else(
// NeoForge Forge versions are in either of these formats:
// - 20.2.29-beta, 20.6.119
// - 26.1.0.10-beta, 26.1.0.16
//
// The first format is the "modern" format for Minecraft versions starting with 1, where the first number is the major MC version,
// the second is the minor MC version, and the third is the NeoForge version.
//
// The second format is the "new-modern" format for Minecraft versions in year-based format, where the first three numbers
// are the Minecraft version (year.release.hotfix), and the fourth, the NeoForge release version, with an optional "beta" suffix.
let major_or_year = parts.next().ok_or_else(
|| crate::ErrorKind::InvalidInput(format!("Unable to find major game version for NeoForge {loader_version}"))
)?;

let minor = parts.next().ok_or_else(
|| crate::ErrorKind::InvalidInput(format!("Unable to find minor game version for NeoForge {loader_version}"))
)?;

let game_version = if minor == "0" {
format!("1.{major}")
} else {
format!("1.{major}.{minor}")
};
let major_or_year = major_or_year.parse::<u32>()?;

// Year-based MC versions started in 2026
let game_version = match major_or_year {
26.. => {
let hotfix = parts.next().ok_or_else(
|| crate::ErrorKind::InvalidInput(format!("Unable to find hotfix version for NeoForge {loader_version}"))
)?;

if hotfix == "0" {
format!("{major_or_year}.{minor}")
} else {
format!("{major_or_year}.{minor}.{hotfix}")
}
}
..26 if minor == "0" => format!("1.{major_or_year}"),
..26 => format!("1.{major_or_year}.{minor}"),
};

Ok(ForgeVersion {
format_version: 2,
Expand Down
5 changes: 4 additions & 1 deletion packages/daedalus/src/minecraft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,20 +454,23 @@ pub enum Argument {
/// An argument which is only applied if certain conditions are met
Ruled {
/// The rules deciding whether the argument(s) is used or not
#[serde(default)]
rules: Vec<Rule>,
/// The container of the argument(s) that should be applied accordingly
value: ArgumentValue,
},
}

#[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Hash, Clone, Copy)]
#[serde(rename_all = "snake_case")]
#[serde(rename_all = "kebab-case")]
/// The type of argument
pub enum ArgumentType {
/// The argument is passed to the game
Game,
/// The argument is passed to the JVM
Jvm,
/// Passed to JVM as well. Includes default arguments to the GC.
DefaultUserJvm,
}

#[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Hash)]
Expand Down
Loading