Skip to content

Commit

Permalink
More Forge versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Scotsguy committed Feb 5, 2020
1 parent 248760c commit 6135902
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ fn main() {
.expect("couldn't get info on the bot user")
.id,
))
.prefix(&std::env::var("BACKGROUND_CAT_PREFIX").unwrap_or_else(|_| "-".to_string()))
.prefix(
&std::env::var("BACKGROUND_CAT_PREFIX").unwrap_or_else(|_| "-".to_string()),
)
.case_insensitivity(true)
})
.group(&STATICTEXT_GROUP)
Expand Down
8 changes: 6 additions & 2 deletions src/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn server_java(log: &str) -> Option<(&str, String)> {
fn buildsystem_forge(log: &str) -> Option<(&str, String)> {
lazy_static! {
static ref RE: Regex =
Regex::new(r"net\.minecraftforge/(?P<major>(2[5-9]|30))\.[0-9]+\.[0-9]+\.json")
Regex::new(r"net\.minecraftforge/(?P<major>(2[5-9]|3[0-1]))\.[0-9]+\.[0-9]+\.json")
.unwrap();
}
if let Some(capture) = RE.captures(log) {
Expand All @@ -51,11 +51,15 @@ fn buildsystem_forge(log: &str) -> Option<(&str, String)> {
"28" => "1.14.4",
"29" => "1.15",
"30" => "1.15.1",
"31" => "1.15.2",
_ => "<unknown version>",
// When adding new versions, change the regex too
};

Some(("‼", format!(
"You're trying to use Forge for Minecraft version {}. This is not supported by MultiMC. For more information, please see [this link.](https://multimc.org/posts/forge-114.html)",
"You're trying to use Forge for Minecraft version {}. \
This is not supported by MultiMC. For more information, please see \
[this link.](https://multimc.org/posts/forge-114.html)",
mc_version)
))
} else {
Expand Down

0 comments on commit 6135902

Please sign in to comment.