mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-14 22:56:18 +01:00
Switch blacklist stat to entry counts.
This commit is contained in:
parent
2c14acc28c
commit
87162acf11
@ -228,23 +228,21 @@ private void setupCustomCharts(Metrics metrics) {
|
||||
return driver instanceof DirectoryYamlDriver ? "yaml" : driver instanceof SQLDriver ? "sql" : "unknown";
|
||||
}));
|
||||
metrics.addCustomChart(new Metrics.SimpleBarChart("blacklist", () -> {
|
||||
int unused = 0;
|
||||
int standard = 0;
|
||||
int whitelist = 0;
|
||||
int blacklisted = 0;
|
||||
int whitelisted = 0;
|
||||
for (BukkitWorldConfiguration worldConfig : platform.getGlobalStateManager().getWorldConfigs()) {
|
||||
Blacklist blacklist = worldConfig.getBlacklist();
|
||||
if (blacklist == null || blacklist.isEmpty()) {
|
||||
unused++;
|
||||
continue;
|
||||
} else if (blacklist.isWhitelist()) {
|
||||
whitelist++;
|
||||
whitelisted += blacklist.getItemCount();
|
||||
} else {
|
||||
standard++;
|
||||
blacklisted += blacklist.getItemCount();
|
||||
}
|
||||
}
|
||||
Map<String, Integer> blacklistCounts = new HashMap<>();
|
||||
blacklistCounts.put("unused", unused);
|
||||
blacklistCounts.put("blacklist", standard);
|
||||
blacklistCounts.put("whitelist", whitelist);
|
||||
blacklistCounts.put("blacklist", blacklisted);
|
||||
blacklistCounts.put("whitelist", whitelisted);
|
||||
return blacklistCounts;
|
||||
}));
|
||||
metrics.addCustomChart(new Metrics.SimplePie("chest_protection", () ->
|
||||
|
Loading…
Reference in New Issue
Block a user