mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Put this function in a better place.
This commit is contained in:
parent
83c4d09093
commit
c8c76f4174
@ -780,9 +780,10 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
||||
}
|
||||
|
||||
// Check if there were any errors
|
||||
if (Misc.noErrorsInConfig(reason)) {
|
||||
if (noErrorsInConfig(reason)) {
|
||||
mcMMO.p.debug("No errors found in " + fileName + "!");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
mcMMO.p.getLogger().warning("Errors were found in " + fileName + "! mcMMO was disabled!");
|
||||
mcMMO.p.getServer().getPluginManager().disablePlugin(mcMMO.p);
|
||||
mcMMO.p.noErrorsInConfigFiles = false;
|
||||
|
@ -7,11 +7,13 @@ import java.io.FileWriter;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.metrics.MetricsManager;
|
||||
|
||||
public abstract class AutoUpdateConfigLoader extends ConfigLoader {
|
||||
@ -125,4 +127,12 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean noErrorsInConfig(List<String> issues) {
|
||||
for (String issue : issues) {
|
||||
mcMMO.p.getLogger().warning(issue);
|
||||
}
|
||||
|
||||
return issues.isEmpty();
|
||||
}
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ public class Config extends AutoUpdateConfigLoader {
|
||||
}
|
||||
|
||||
// Check if there were any errors
|
||||
if (Misc.noErrorsInConfig(reason)) {
|
||||
if (noErrorsInConfig(reason)) {
|
||||
mcMMO.p.debug("No errors found in " + fileName + "!");
|
||||
}
|
||||
else {
|
||||
|
@ -302,14 +302,6 @@ public final class Misc {
|
||||
return partialName;
|
||||
}
|
||||
|
||||
public static boolean noErrorsInConfig(List<String> issues) {
|
||||
for (String issue : issues) {
|
||||
mcMMO.p.getLogger().warning(issue);
|
||||
}
|
||||
|
||||
return issues.isEmpty();
|
||||
}
|
||||
|
||||
public static Random getRandom() {
|
||||
return random;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user