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:
NotEvil
2026-04-16 13:16:05 +02:00
parent 683eeec11f
commit 4e136cff96
23 changed files with 461 additions and 88 deletions

View File

@@ -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
);
}
/**