@@ -12,13 +12,13 @@ pub fn common_mistakes(input: &str) -> Vec<(&str, String)> {
12
12
13
13
pub ( crate ) type Check = fn ( & str ) -> Option < ( & str , String ) > ;
14
14
15
- pub ( crate ) const PARSERS : [ Check ; 16 ] = [
15
+ pub ( crate ) const PARSERS : [ Check ; 18 ] = [
16
16
multimc_in_program_files,
17
17
macos_too_new_java,
18
18
multimc_in_onedrive_managed_folder,
19
- //major_java_version,
20
19
forge_too_new_java,
21
20
one_seventeen_plus_java_too_old,
21
+ two_one_plus_java_too_old,
22
22
m1_failed_to_find_service_port,
23
23
pixel_format_not_accelerated_win10,
24
24
intel_graphics_icd_dll,
@@ -27,9 +27,9 @@ pub(crate) const PARSERS: [Check; 16] = [
27
27
shadermod_optifine_conflict,
28
28
fabric_api_missing,
29
29
java_architecture,
30
+ detect_temp_directories,
30
31
using_system_glfw,
31
32
using_system_openal,
32
- //old_multimc_version,
33
33
reboot_required,
34
34
] ;
35
35
@@ -101,26 +101,6 @@ fn multimc_in_onedrive_managed_folder(log: &str) -> Option<(&str, String)> {
101
101
None
102
102
}
103
103
}
104
- /*
105
- fn major_java_version(log: &str) -> Option<(&str, String)> {
106
- lazy_static! {
107
- static ref RE: Regex =
108
- Regex::new(r"Java is version (1.)??(?P<ver>[6-9]|[1-9][0-9])+(\..+)??,").unwrap();
109
- }
110
- match RE.captures(log) {
111
- Some(capture) if capture.name("ver")?.as_str() == "8" => None,
112
- Some(capture) => Some((
113
- "❗",
114
- format!(
115
- "You're using Java {}. Versions other than Java 8 are not designed to be used with Minecraft and may cause issues. \
116
- [See here for help installing the correct version.](https://github.com/MultiMC/MultiMC5/wiki/Using-the-right-Java)",
117
- capture.name("ver")?.as_str()
118
- ),
119
- )),
120
- _ => None,
121
- }
122
- }
123
- */
124
104
125
105
fn forge_too_new_java ( log : & str ) -> Option < ( & str , String ) > {
126
106
const URLCLASSLOADER_CAST : & str = "java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader" ;
@@ -132,14 +112,14 @@ fn forge_too_new_java(log: &str) -> Option<(&str, String)> {
132
112
}
133
113
134
114
fn one_seventeen_plus_java_too_old ( log : & str ) -> Option < ( & str , String ) > {
135
- const UNSUPPORTED_CLASS_VERSION_ERROR : & str = "java.lang.UnsupportedClassVersionError: net/minecraft/client/main/Main" ;
136
115
const FABRIC_JAVA_VERSION_ERROR : & str = "fabric requires {java @ [>=16]}" ;
137
116
const FABRIC_JAVA_VERSION_ERROR_SEVENTEEN : & str = "fabric requires {java @ [>=17]}" ;
117
+ const JAVA_16_WARNING : & str = "Minecraft 21w19a and above require the use of Java 16" ;
138
118
const JAVA_17_WARNING : & str = "Minecraft 1.18 Pre Release 2 and above require the use of Java 17" ;
139
119
140
- if log. contains ( UNSUPPORTED_CLASS_VERSION_ERROR )
141
- || log. contains ( FABRIC_JAVA_VERSION_ERROR )
120
+ if log. contains ( FABRIC_JAVA_VERSION_ERROR )
142
121
|| log. contains ( FABRIC_JAVA_VERSION_ERROR_SEVENTEEN )
122
+ || log. contains ( JAVA_16_WARNING )
143
123
|| log. contains ( JAVA_17_WARNING )
144
124
{
145
125
Some ( ( "‼" , RESPONSES . get ( "use-java-17" ) ?. to_string ( ) ) )
@@ -148,6 +128,18 @@ fn one_seventeen_plus_java_too_old(log: &str) -> Option<(&str, String)> {
148
128
}
149
129
}
150
130
131
+ fn two_one_plus_java_too_old ( log : & str ) -> Option < ( & str , String ) > {
132
+ const JAVA_CHECK_CLASS_FILE_VERSION : & str = "(class file version 65.0)" ;
133
+ const JAVA_CHECK_CLASS_FILE_VERSION_MMC : & str = "Minecraft 24w14a and above require the use of Java 21" ;
134
+ if log. contains ( JAVA_CHECK_CLASS_FILE_VERSION )
135
+ || log. contains ( JAVA_CHECK_CLASS_FILE_VERSION_MMC )
136
+ {
137
+ Some ( ( "‼" , RESPONSES . get ( "use-java-21" ) ?. to_string ( ) ) )
138
+ } else {
139
+ None
140
+ }
141
+ }
142
+
151
143
fn m1_failed_to_find_service_port ( log : & str ) -> Option < ( & str , String ) > {
152
144
const TRIGGER : & str = "java.lang.IllegalStateException: GLFW error before init: [0x10008]Cocoa: Failed to find service port for display" ;
153
145
if log. contains ( TRIGGER ) {
@@ -193,6 +185,21 @@ fn java_architecture(log: &str) -> Option<(&str, String)> {
193
185
}
194
186
}
195
187
188
+ fn detect_temp_directories ( log : & str ) -> Option < ( & str , String ) > {
189
+ lazy_static ! {
190
+ static ref RE : Regex = Regex :: new( r"Minecraft folder is:\n[A-Z]:/([^/]+/)*Temp" ) . unwrap( ) ;
191
+ }
192
+ if log. contains ( "Rar$" ) {
193
+ Some ( ( "‼" , RESPONSES . get ( "winrar-temp" ) ?. to_string ( ) ) )
194
+ }
195
+ else if RE . is_match ( log) && !log. contains ( "forge_installer" ) {
196
+ Some ( ( "‼" , RESPONSES . get ( "temp-folder" ) ?. to_string ( ) ) )
197
+ }
198
+ else {
199
+ None
200
+ }
201
+ }
202
+
196
203
fn using_system_openal ( log : & str ) -> Option < ( & str , String ) > {
197
204
const TRIGGER : & str = "Using system OpenAL." ;
198
205
if log. contains ( TRIGGER ) {
@@ -210,43 +217,6 @@ fn using_system_glfw(log: &str) -> Option<(&str, String)> {
210
217
None
211
218
}
212
219
}
213
- /* Regex is incorrect/
214
- fn old_multimc_version(log: &str) -> Option<(&str, String)> {
215
- lazy_static! {
216
- static ref RE: Regex =
217
- Regex::new(r"MultiMC version: (?P<major_ver>0\.[0-9]+\.[0-9]+-(?P<build>[0-9]+))\n")
218
- .unwrap();
219
- }
220
- if let Some(capture) = RE.captures(log) {
221
- match capture.name("build")?.as_str().parse::<u32>() {
222
- Ok(o) => {
223
- if o < 900 {
224
- Some((
225
- "❗",
226
- format!(
227
- "You seem to be using an old build of MultiMC ({}). \
228
- Please update to a more recent version.",
229
- capture.name("major_ver")?.as_str()
230
- ),
231
- ))
232
- } else {
233
- None
234
- }
235
- }
236
- Err(_) => Some((
237
- "❗",
238
- format!(
239
- "You seem to be using an unofficial version of MultiMC ({}). \
240
- Please only use MultiMC downloaded from [multimc.org](https://multimc.org/#Download).",
241
- capture.name("major_ver")?.as_str()
242
- ),
243
- )),
244
- }
245
- } else {
246
- None
247
- }
248
- }
249
- */
250
220
251
221
fn reboot_required ( log : & str ) -> Option < ( & str , String ) > {
252
222
const TRIGGER : & str = "Couldn't extract native jar" ;
0 commit comments