mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Add graph to see if any config values have been changed from the default, or if a server is 100% vanilla configs
This commit is contained in:
parent
e50eb1963f
commit
3dc1afde7e
@ -16,6 +16,7 @@ import org.bukkit.configuration.file.FileConfiguration;
|
|||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
|
import com.gmail.nossr50.util.metrics.MetricsManager;
|
||||||
|
|
||||||
public abstract class ConfigLoader {
|
public abstract class ConfigLoader {
|
||||||
protected static final mcMMO plugin = mcMMO.p;
|
protected static final mcMMO plugin = mcMMO.p;
|
||||||
@ -129,6 +130,14 @@ public abstract class ConfigLoader {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
for (String key : configKeys) {
|
||||||
|
if (!config.isConfigurationSection(key) && !config.get(key).equals(internalConfig.get(key))) {
|
||||||
|
MetricsManager.customConfig();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void loadKeys();
|
protected abstract void loadKeys();
|
||||||
|
@ -22,6 +22,8 @@ public class MetricsManager {
|
|||||||
private static Tracker chimeraUseTracker;
|
private static Tracker chimeraUseTracker;
|
||||||
private static Tracker chimeraServerUseTracker;
|
private static Tracker chimeraServerUseTracker;
|
||||||
|
|
||||||
|
private static boolean customConfig = false;
|
||||||
|
|
||||||
private static DataTracker tracker;
|
private static DataTracker tracker;
|
||||||
private static EMetrics emetrics;
|
private static EMetrics emetrics;
|
||||||
|
|
||||||
@ -220,6 +222,26 @@ public class MetricsManager {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Vanilla v Modified config graph
|
||||||
|
Graph customConfigGraph = metrics.createGraph("Modified Configs");
|
||||||
|
|
||||||
|
if (customConfig) {
|
||||||
|
customConfigGraph.addPlotter(new Metrics.Plotter("Edited") {
|
||||||
|
@Override
|
||||||
|
public int getValue() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
customConfigGraph.addPlotter(new Metrics.Plotter("Vanilla") {
|
||||||
|
@Override
|
||||||
|
public int getValue() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/* Debug stuff
|
/* Debug stuff
|
||||||
tracker = emetrics.getDataTracker();
|
tracker = emetrics.getDataTracker();
|
||||||
tracker.enable();
|
tracker.enable();
|
||||||
@ -239,6 +261,10 @@ public class MetricsManager {
|
|||||||
chimeraServerUseTracker.increment();
|
chimeraServerUseTracker.increment();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void customConfig() {
|
||||||
|
customConfig = true;
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private static void debug() {
|
private static void debug() {
|
||||||
emetrics.getMetrics().flush();
|
emetrics.getMetrics().flush();
|
||||||
|
Loading…
Reference in New Issue
Block a user