centralize all ModConfig.SERVER reads through SettingsAccessor
No more direct ModConfig.SERVER access outside SettingsAccessor. 32 new accessor methods, 21 consumer files rerouted.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package com.tiedup.remake.util;
|
||||
|
||||
import com.tiedup.remake.core.ModConfig;
|
||||
import com.tiedup.remake.core.SettingsAccessor;
|
||||
|
||||
/**
|
||||
* GagMaterial DNA - Defines the "sound" and behavior of different gag materials.
|
||||
@@ -180,28 +180,15 @@ public enum GagMaterial {
|
||||
}
|
||||
|
||||
public float getComprehension() {
|
||||
String key = this.name().toLowerCase();
|
||||
if (
|
||||
ModConfig.SERVER != null &&
|
||||
ModConfig.SERVER.gagComprehension.containsKey(key)
|
||||
) {
|
||||
return ModConfig.SERVER.gagComprehension
|
||||
.get(key)
|
||||
.get()
|
||||
.floatValue();
|
||||
}
|
||||
return defaultComprehension;
|
||||
return SettingsAccessor.getGagComprehension(
|
||||
this.name().toLowerCase(), defaultComprehension
|
||||
);
|
||||
}
|
||||
|
||||
public double getTalkRange() {
|
||||
String key = this.name().toLowerCase();
|
||||
if (
|
||||
ModConfig.SERVER != null &&
|
||||
ModConfig.SERVER.gagRange.containsKey(key)
|
||||
) {
|
||||
return ModConfig.SERVER.gagRange.get(key).get();
|
||||
}
|
||||
return defaultTalkRange;
|
||||
return SettingsAccessor.getGagTalkRange(
|
||||
this.name().toLowerCase(), defaultTalkRange
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user