mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-20 12:19:52 +00:00
Null-check strategy setting to prevent log spam when not explicitly set
This commit is contained in:
1 parent
c5e97a08d6
commit
6ed36dff60
2 files changed
+6
-3
No files matched your search
@@ -406,7 +406,7 @@ public final class MixinEnvironment implements ITokenProvider {
|
||||
/**
|
||||
* Default value for string properties
|
||||
*/
|
||||
final String defaultStringValue;
|
||||
final String defaultValue;
|
||||
|
||||
/**
|
||||
* Whether this property is boolean or not
|
||||
@@ -445,7 +445,7 @@ public final class MixinEnvironment implements ITokenProvider {
|
||||
private Option(Option parent, String property, boolean flag, String defaultStringValue) {
|
||||
this.parent = parent;
|
||||
this.property = (parent != null ? parent.property : Option.PREFIX) + "." + property;
|
||||
this.defaultStringValue = defaultStringValue;
|
||||
this.defaultValue = defaultStringValue;
|
||||
this.flag = flag;
|
||||
int depth = 0;
|
||||
for (; parent != null; depth++) {
|
||||
@@ -480,7 +480,7 @@ public final class MixinEnvironment implements ITokenProvider {
|
||||
}
|
||||
|
||||
String getStringValue() {
|
||||
return (this.parent == null || this.parent.getBooleanValue()) ? System.getProperty(this.property) : this.defaultStringValue;
|
||||
return (this.parent == null || this.parent.getBooleanValue()) ? System.getProperty(this.property, this.defaultValue) : this.defaultValue;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
@@ -828,6 +828,9 @@ public class MixinApplicatorStandard {
|
||||
|
||||
private InitialiserInjectionMode getInitialiserInjectionMode(MixinEnvironment environment) {
|
||||
String strMode = environment.getOptionValue(Option.INITIALISER_INJECTION_MODE);
|
||||
if (strMode == null) {
|
||||
return InitialiserInjectionMode.DEFAULT;
|
||||
}
|
||||
try {
|
||||
return InitialiserInjectionMode.valueOf(strMode.toUpperCase());
|
||||
} catch (Exception ex) {
|
||||
|
||||
Reference in new issue
Block a user