This commit is contained in:
GJ 2012-05-23 11:16:23 -04:00
parent 66ad909908
commit 0fe90df01e
2 changed files with 18 additions and 8 deletions

View File

@ -18,30 +18,39 @@ public class RepairConfigManager {
File dataFolder = plugin.getDataFolder(); File dataFolder = plugin.getDataFolder();
File vanilla = new File(dataFolder, "repair.vanilla.yml"); File vanilla = new File(dataFolder, "repair.vanilla.yml");
if(!vanilla.exists()) { if (!vanilla.exists()) {
plugin.saveResource("repair.vanilla.yml", false); plugin.saveResource("repair.vanilla.yml", false);
} }
for(String location : dataFolder.list()) { for (String location : dataFolder.list()) {
if(!pattern.matcher(location).matches()) continue; if (!pattern.matcher(location).matches()) {
continue;
}
plugin.getLogger().info("Loading " + location + " repair config file..."); plugin.getLogger().info("Loading " + location + " repair config file...");
File file = new File(dataFolder, location); File file = new File(dataFolder, location);
if(file.isDirectory()) continue;
if (file.isDirectory()) {
continue;
}
RepairConfig rConfig = new RepairConfig(plugin, location); RepairConfig rConfig = new RepairConfig(plugin, location);
rConfig.load(); rConfig.load();
List<Repairable> rConfigRepairables = rConfig.getLoadedRepairables(); List<Repairable> rConfigRepairables = rConfig.getLoadedRepairables();
if(rConfigRepairables != null) {
if (rConfigRepairables != null) {
repairables.addAll(rConfigRepairables); repairables.addAll(rConfigRepairables);
} }
} }
} }
public List<Repairable> getLoadedRepairables() { public List<Repairable> getLoadedRepairables() {
if(repairables == null) return new ArrayList<Repairable>(); if (repairables == null) {
return new ArrayList<Repairable>();
}
return repairables; return repairables;
} }
} }

View File

@ -161,14 +161,15 @@ public class mcMMO extends JavaPlugin {
Graph graph = metrics.createGraph("Percentage of servers using timings"); Graph graph = metrics.createGraph("Percentage of servers using timings");
if(pm.useTimings()) { if (pm.useTimings()) {
graph.addPlotter(new Metrics.Plotter("Enabled") { graph.addPlotter(new Metrics.Plotter("Enabled") {
@Override @Override
public int getValue() { public int getValue() {
return 1; return 1;
} }
}); });
} else { }
else {
graph.addPlotter(new Metrics.Plotter("Disabled") { graph.addPlotter(new Metrics.Plotter("Disabled") {
@Override @Override
public int getValue() { public int getValue() {