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

Validate that at least one loader is checked #24

Closed
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A generator for Architectury mod templates with a web UI and an interactive comm

Run `./gradlew buildWeb`. The output will be in `build/web`.

The local test web server can be launched with `./gradlew runTestServer` (requires Python).
The local test web server can be launched with `./gradlew runTestServer` (requires Python). While running, this web server can be viewed at http://localhost:8000.

## Building (native)

Expand Down
7 changes: 7 additions & 0 deletions res/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ function refreshFabricLikeCheckbox() {
fabricLikeInput.disabled = !hasFabricLike;
}

function isLoaderChecked() {
return document.getElementById("fabric-loader-input").checked || document.getElementById("forge-loader-input").checked || document.getElementById("neoforge-loader-input").checked || document.getElementById("quilt-loader-input").checked
}

document.getElementById("generate-button").onclick = async () => {
updateState();

Expand All @@ -186,6 +190,9 @@ document.getElementById("generate-button").onclick = async () => {
} else if (state.package_name === "") {
showError("Package name is empty");
return;
} else if (!isLoaderChecked()) {
showError("You need to choose at least one subproject first!")
return
}

clearError();
Expand Down
2 changes: 1 addition & 1 deletion src/app/versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

pub const LOOM_VERSION: &'static str = "1.6-SNAPSHOT";
pub const LOOM_VERSION: &'static str = "1.7-SNAPSHOT";
pub const PLUGIN_VERSION: &'static str = "3.4-SNAPSHOT";

use miette::Result;
Expand Down
37 changes: 37 additions & 0 deletions version_resolver/src/minecraft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ pub enum MinecraftVersion {
Minecraft1_20_6,
#[serde(rename = "1.21")]
Minecraft1_21,
#[serde(rename = "1.21.1")]
Minecraft1_21_1,
#[serde(rename = "1.21.2")]
Minecraft1_21_2,
#[serde(rename = "1.21.3")]
Minecraft1_21_3,
#[serde(rename = "1.21.4")]
Minecraft1_21_4,
}

impl MinecraftVersion {
Expand All @@ -62,6 +70,10 @@ impl MinecraftVersion {
Self::Minecraft1_20_5 => "1.20.5",
Self::Minecraft1_20_6 => "1.20.6",
Self::Minecraft1_21 => "1.21",
Self::Minecraft1_21_1 => "1.21.1",
Self::Minecraft1_21_2 => "1.21.2",
Self::Minecraft1_21_3 => "1.21.3",
Self::Minecraft1_21_4 => "1.21.4",
}
}

Expand Down Expand Up @@ -127,6 +139,10 @@ impl MinecraftVersion {
Self::Minecraft1_20_5 => None,
Self::Minecraft1_20_6 => None,
Self::Minecraft1_21 => None,
Self::Minecraft1_21_1 => None,
Self::Minecraft1_21_2 => None,
Self::Minecraft1_21_3 => None,
Self::Minecraft1_21_4 => None,
}
}

Expand All @@ -147,6 +163,11 @@ impl MinecraftVersion {
Self::Minecraft1_20_5 => "12.0",
Self::Minecraft1_20_6 => "12",
Self::Minecraft1_21 => "13",
Self::Minecraft1_21_1 => "13",
Self::Minecraft1_21_2 => "14",
Self::Minecraft1_21_3 => "14",
Self::Minecraft1_21_4 => "15",

}
}

Expand All @@ -156,6 +177,10 @@ impl MinecraftVersion {
Self::Minecraft1_20_5 => Some("2"),
Self::Minecraft1_20_6 => Some("2"),
Self::Minecraft1_21 => Some("4"),
Self::Minecraft1_21_1 => Some("4"),
Self::Minecraft1_21_2 => Some("4"),
Self::Minecraft1_21_3 => Some("4"),
Self::Minecraft1_21_4 => Some("4"),
_ => None,
}
}
Expand All @@ -166,6 +191,10 @@ impl MinecraftVersion {
Self::Minecraft1_20_5 => Some("20.5"),
Self::Minecraft1_20_6 => Some("20.6"),
Self::Minecraft1_21 => Some("21.0"),
Self::Minecraft1_21_1 => Some("21.1"),
Self::Minecraft1_21_2 => Some("21.2"),
Self::Minecraft1_21_3 => Some("21.3"),
Self::Minecraft1_21_4 => Some("21.4"),
_ => None,
}
}
Expand All @@ -175,6 +204,10 @@ impl MinecraftVersion {
Self::Minecraft1_20_5 => Some("1.20.5"),
Self::Minecraft1_20_6 => Some("1.20.6"),
Self::Minecraft1_21 => Some("1.21"),
Self::Minecraft1_21_1 => Some("1.21"),
Self::Minecraft1_21_2 => Some("1.21"),
Self::Minecraft1_21_3 => Some("1.21"),
Self::Minecraft1_21_4 => Some("1.21"),
_ => None,
}
}
Expand All @@ -196,6 +229,10 @@ impl MinecraftVersion {
Self::Minecraft1_20_5 => None,
Self::Minecraft1_20_6 => None,
Self::Minecraft1_21 => None,
Self::Minecraft1_21_1 => None,
Self::Minecraft1_21_2 => None,
Self::Minecraft1_21_3 => None,
Self::Minecraft1_21_4 => None,
}
}

Expand Down
Loading