Skip to content

Commit

Permalink
Add Shadermod/Optifine parser
Browse files Browse the repository at this point in the history
Thanks zetabite
  • Loading branch information
Scotsguy committed Feb 16, 2020
1 parent ab3d147 commit cefa9b1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use regex::Regex;

pub(crate) type Check = fn(&str) -> Option<(&str, String)>;

pub(crate) const PARSERS: [Check; 11] = [
pub(crate) const PARSERS: [Check; 12] = [
multimc_in_program_files,
server_java,
buildsystem_forge,
Expand All @@ -15,6 +15,7 @@ pub(crate) const PARSERS: [Check; 11] = [
pixel_format_not_accelerated_win10,
id_range_exceeded,
out_of_memory_error,
shadermod_optifine_conflict,
java_architecture,
old_multimc_version,
ram_amount,
Expand Down Expand Up @@ -80,6 +81,7 @@ fn id_range_exceeded(log: &str) -> Option<(&str, String)> {
None
}
}

fn out_of_memory_error(log: &str) -> Option<(&str, String)> {
const TRIGGER: &str = "java.lang.OutOfMemoryError";
if log.contains(TRIGGER) {
Expand All @@ -89,6 +91,15 @@ fn out_of_memory_error(log: &str) -> Option<(&str, String)> {
}
}

fn shadermod_optifine_conflict(log: &str) -> Option<(&str, String)> {
const TRIGGER: &str = "java.lang.RuntimeException: Shaders Mod detected. Please remove it, OptiFine has built-in support for shaders.";
if log.contains(TRIGGER) {
Some(("‼", "You've installed Shaders Mod alongside OptiFine. OptiFine has built-in shader support, so you should remove Shaders Mod".to_string()))
} else {
None
}
}

fn multimc_in_onedrive_managed_folder(log: &str) -> Option<(&str, String)> {
lazy_static! {
static ref RE: Regex = Regex::new(r"Minecraft folder is:\nC:/.+/.+/OneDrive").unwrap();
Expand Down

0 comments on commit cefa9b1

Please sign in to comment.