Fix custom charts
Probably
This commit is contained in:
parent
12a8ccf3ce
commit
d46adfd957
1 changed files with 3 additions and 3 deletions
|
@ -5,7 +5,7 @@ import de.jaschastarke.modularize.IModule;
|
||||||
import de.jaschastarke.modularize.ModuleEntry;
|
import de.jaschastarke.modularize.ModuleEntry;
|
||||||
import de.jaschastarke.modularize.ModuleEntry.ModuleState;
|
import de.jaschastarke.modularize.ModuleEntry.ModuleState;
|
||||||
import org.bstats.bukkit.Metrics;
|
import org.bstats.bukkit.Metrics;
|
||||||
import org.bstats.charts.MultiLineChart;
|
import org.bstats.charts.AdvancedPie;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -23,14 +23,14 @@ public class FeatureMetrics extends CoreModule<LimitedCreative> implements Liste
|
||||||
if (bstats == null) {
|
if (bstats == null) {
|
||||||
bstats = new Metrics(plugin, 10413);
|
bstats = new Metrics(plugin, 10413);
|
||||||
|
|
||||||
bstats.addCustomChart(new MultiLineChart("Module Usage", () -> {
|
bstats.addCustomChart(new AdvancedPie("module_usage", () -> {
|
||||||
HashMap<String, Integer> ret = new HashMap<>();
|
HashMap<String, Integer> ret = new HashMap<>();
|
||||||
for (final ModuleEntry<IModule> mod : plugin.getModules())
|
for (final ModuleEntry<IModule> mod : plugin.getModules())
|
||||||
if (mod.getModule() instanceof CoreModule<?>)
|
if (mod.getModule() instanceof CoreModule<?>)
|
||||||
ret.put(((CoreModule<?>) mod.getModule()).getName(), mod.getState() == ModuleState.ENABLED ? 1 : 0);
|
ret.put(((CoreModule<?>) mod.getModule()).getName(), mod.getState() == ModuleState.ENABLED ? 1 : 0);
|
||||||
return ret;
|
return ret;
|
||||||
}));
|
}));
|
||||||
bstats.addCustomChart(new MultiLineChart("Dependencies", () -> {
|
bstats.addCustomChart(new AdvancedPie("dependencies", () -> {
|
||||||
HashMap<String, Integer> ret = new HashMap<>();
|
HashMap<String, Integer> ret = new HashMap<>();
|
||||||
for (final String dep : plugin.getDescription().getSoftDepend())
|
for (final String dep : plugin.getDescription().getSoftDepend())
|
||||||
ret.put(dep, plugin.getServer().getPluginManager().isPluginEnabled(dep) ? 1 : 0);
|
ret.put(dep, plugin.getServer().getPluginManager().isPluginEnabled(dep) ? 1 : 0);
|
||||||
|
|
Loading…
Reference in a new issue