mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-03 21:15:28 +02:00
Config validation rewrite part 1
This commit is contained in:
@@ -8,7 +8,6 @@ public class SoundConfig extends BukkitConfig {
|
||||
|
||||
public SoundConfig() {
|
||||
super("sounds.yml");
|
||||
validate();
|
||||
instance = this;
|
||||
}
|
||||
|
||||
@@ -25,22 +24,24 @@ public class SoundConfig extends BukkitConfig {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean validateKeys() {
|
||||
protected void validateConfigKeys() {
|
||||
//TODO: Rewrite legacy validation code
|
||||
for (SoundType soundType : SoundType.values()) {
|
||||
if (config.getDouble("Sounds." + soundType.toString() + ".Volume") < 0) {
|
||||
mcMMO.p.getLogger().info("[mcMMO] Sound volume cannot be below 0 for " + soundType);
|
||||
return false;
|
||||
//TODO: Rewrite legacy validation code
|
||||
//return false;
|
||||
}
|
||||
|
||||
//Sounds with custom pitching don't use pitch values
|
||||
if (!soundType.usesCustomPitch()) {
|
||||
if (config.getDouble("Sounds." + soundType + ".Pitch") < 0) {
|
||||
mcMMO.p.getLogger().info("[mcMMO] Sound pitch cannot be below 0 for " + soundType);
|
||||
return false;
|
||||
//TODO: Rewrite legacy validation code
|
||||
//return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public float getMasterVolume() {
|
||||
|
Reference in New Issue
Block a user