File tree Expand file tree Collapse file tree 4 files changed +12
-5
lines changed
src/main/java/com/probejs Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ public static void register(
106
106
}
107
107
108
108
private static int dump (CommandContext <CommandSourceStack > context ) {
109
- if (!ProbeJS .RHIZO_LOADED ) {
109
+ if (!ProbeJS .isRhizoLoaded () ) {
110
110
sendSuccess (PText .translatable ("probejs.rhizo_missing" ).withStyle (ChatFormatting .RED ), context );
111
111
sendSuccess (PText .translatable ("probejs.download_rhizo_help" )
112
112
.append (PText .url ("CurseForge" ,
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public class ProbeJS {
23
23
.create ();
24
24
public static final ProbeConfig CONFIG = ProbeConfig .instance ();
25
25
public static final boolean ENABLED = CONFIG .enabled ;
26
- public static final boolean RHIZO_LOADED = Platform . isModLoaded ( "rhizo" ) ;
26
+ public static Boolean RHIZO_LOADED = null ;
27
27
28
28
public ProbeJS () {
29
29
CommandRegistrationEvent .EVENT .register (ProbeCommands ::register );
@@ -41,4 +41,11 @@ public ProbeJS() {
41
41
);
42
42
}
43
43
}
44
+
45
+ public static boolean isRhizoLoaded () {
46
+ if (RHIZO_LOADED == null ) {
47
+ RHIZO_LOADED = Platform .isModLoaded ("rhizo" );
48
+ }
49
+ return RHIZO_LOADED ;
50
+ }
44
51
}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public static void skipClass(Class<?>... clazz) {
22
22
}
23
23
24
24
public static boolean acceptMethod (String methodName ) {
25
- if (!ProbeJS .RHIZO_LOADED ) {
25
+ if (!ProbeJS .isRhizoLoaded () ) {
26
26
//fallback for Rhino
27
27
return !methodName .equals ("constructor" );
28
28
}
@@ -32,7 +32,7 @@ public static boolean acceptMethod(String methodName) {
32
32
}
33
33
34
34
public static boolean acceptField (String fieldName ) {
35
- if (!ProbeJS .RHIZO_LOADED ) {
35
+ if (!ProbeJS .isRhizoLoaded () ) {
36
36
//fallback for Rhino
37
37
return !fieldName .equals ("constructor" );
38
38
}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ public static IRemapper getRemapper() {
16
16
}
17
17
18
18
public static void refreshRemapper () {
19
- if (!ProbeJS .RHIZO_LOADED ) {
19
+ if (!ProbeJS .isRhizoLoaded () ) {
20
20
ProbeJS .LOGGER .warn ("You seem to be using Rhino instead of newer Rhizo, skipping Remapper check" );
21
21
return ;
22
22
}
You can’t perform that action at this time.
0 commit comments