Removed warnings if custom mining is disabled

This commit is contained in:
Jules 2025-11-03 11:52:04 +01:00
parent 14aad71f2f
commit 9790cfac51

View File

@ -205,12 +205,15 @@ public class CustomBlockManager extends SpecificProfessionManager {
this.protectVanillaBlocks = config.getBoolean("protect-vanilla-blocks");
this.enableToolRestrictions = config.getBoolean("enable-tool-restrictions");
for (String key : config.getStringList("conditions"))
try {
customMineConditions.add(MMOCore.plugin.loadManager.loadCondition(new MMOLineConfig(key)));
} catch (IllegalArgumentException exception) {
MMOCore.plugin.getLogger().log(Level.WARNING, "Could not load custom mining condition '" + key + "': " + exception.getMessage());
}
// Avoid warnings if disabled
if (enabled)
for (String key : config.getStringList("conditions"))
try {
customMineConditions.add(MMOCore.plugin.loadManager.loadCondition(new MMOLineConfig(key)));
} catch (IllegalArgumentException exception) {
MMOCore.plugin.getLogger().log(Level.WARNING, "Could not load custom mining condition '" + key + "': " + exception.getMessage());
}
else customMineConditions.clear();
}
@Deprecated