diff --git a/src/main/java/com/garbagemule/MobArena/MobArena.java b/src/main/java/com/garbagemule/MobArena/MobArena.java index 291c6ef..32d7ac6 100644 --- a/src/main/java/com/garbagemule/MobArena/MobArena.java +++ b/src/main/java/com/garbagemule/MobArena/MobArena.java @@ -6,7 +6,12 @@ import com.garbagemule.MobArena.framework.ArenaMaster; import com.garbagemule.MobArena.listeners.MAGlobalListener; import com.garbagemule.MobArena.listeners.MagicSpellsListener; import com.garbagemule.MobArena.metrics.ArenaCountChart; +import com.garbagemule.MobArena.metrics.ClassChestsChart; import com.garbagemule.MobArena.metrics.ClassCountChart; +import com.garbagemule.MobArena.metrics.FoodRegenChart; +import com.garbagemule.MobArena.metrics.IsolatedChatChart; +import com.garbagemule.MobArena.metrics.MonsterInfightChart; +import com.garbagemule.MobArena.metrics.PvpEnabledChart; import com.garbagemule.MobArena.metrics.VaultChart; import com.garbagemule.MobArena.signs.ArenaSign; import com.garbagemule.MobArena.signs.SignBootstrap; @@ -269,6 +274,11 @@ public class MobArena extends JavaPlugin metrics.addCustomChart(new VaultChart(this)); metrics.addCustomChart(new ArenaCountChart(this)); metrics.addCustomChart(new ClassCountChart(this)); + metrics.addCustomChart(new ClassChestsChart(this)); + metrics.addCustomChart(new FoodRegenChart(this)); + metrics.addCustomChart(new IsolatedChatChart(this)); + metrics.addCustomChart(new MonsterInfightChart(this)); + metrics.addCustomChart(new PvpEnabledChart(this)); } private void loadAbilities() { diff --git a/src/main/java/com/garbagemule/MobArena/metrics/ClassChestsChart.java b/src/main/java/com/garbagemule/MobArena/metrics/ClassChestsChart.java new file mode 100644 index 0000000..3d34ad8 --- /dev/null +++ b/src/main/java/com/garbagemule/MobArena/metrics/ClassChestsChart.java @@ -0,0 +1,18 @@ +package com.garbagemule.MobArena.metrics; + +import com.garbagemule.MobArena.MobArena; +import com.garbagemule.MobArena.framework.Arena; +import org.bstats.bukkit.Metrics; + +public class ClassChestsChart extends Metrics.SimplePie { + + public ClassChestsChart(MobArena plugin) { + super("class_chests_pie", () -> usesClassChests(plugin) ? "Yes" : "No"); + } + + private static boolean usesClassChests(MobArena plugin) { + return plugin.getArenaMaster().getArenas().stream() + .anyMatch(arena -> arena.getSettings().getBoolean("use-class-chests", false)); + } + +} diff --git a/src/main/java/com/garbagemule/MobArena/metrics/FoodRegenChart.java b/src/main/java/com/garbagemule/MobArena/metrics/FoodRegenChart.java new file mode 100644 index 0000000..1d2ed8d --- /dev/null +++ b/src/main/java/com/garbagemule/MobArena/metrics/FoodRegenChart.java @@ -0,0 +1,17 @@ +package com.garbagemule.MobArena.metrics; + +import com.garbagemule.MobArena.MobArena; +import org.bstats.bukkit.Metrics; + +public class FoodRegenChart extends Metrics.SimplePie { + + public FoodRegenChart(MobArena plugin) { + super("food_regen_pie", () -> usesFoodRegen(plugin) ? "Yes" : "No"); + } + + private static boolean usesFoodRegen(MobArena plugin) { + return plugin.getArenaMaster().getArenas().stream() + .anyMatch(arena -> arena.getSettings().getBoolean("food-regen", false)); + } + +} diff --git a/src/main/java/com/garbagemule/MobArena/metrics/IsolatedChatChart.java b/src/main/java/com/garbagemule/MobArena/metrics/IsolatedChatChart.java new file mode 100644 index 0000000..b55b10a --- /dev/null +++ b/src/main/java/com/garbagemule/MobArena/metrics/IsolatedChatChart.java @@ -0,0 +1,18 @@ +package com.garbagemule.MobArena.metrics; + +import com.garbagemule.MobArena.MobArena; +import com.garbagemule.MobArena.framework.Arena; +import org.bstats.bukkit.Metrics; + +public class IsolatedChatChart extends Metrics.SimplePie { + + public IsolatedChatChart(MobArena plugin) { + super("isolated_chat_pie", () -> usesIsolatedChat(plugin) ? "Yes" : "No"); + } + + private static boolean usesIsolatedChat(MobArena plugin) { + return plugin.getArenaMaster().getArenas().stream() + .anyMatch(Arena::hasIsolatedChat); + } + +} diff --git a/src/main/java/com/garbagemule/MobArena/metrics/MonsterInfightChart.java b/src/main/java/com/garbagemule/MobArena/metrics/MonsterInfightChart.java new file mode 100644 index 0000000..9cb463c --- /dev/null +++ b/src/main/java/com/garbagemule/MobArena/metrics/MonsterInfightChart.java @@ -0,0 +1,17 @@ +package com.garbagemule.MobArena.metrics; + +import com.garbagemule.MobArena.MobArena; +import org.bstats.bukkit.Metrics; + +public class MonsterInfightChart extends Metrics.SimplePie { + + public MonsterInfightChart(MobArena plugin) { + super("monster_infight_pie", () -> usesMonsterInfight(plugin) ? "Yes" : "No"); + } + + private static boolean usesMonsterInfight(MobArena plugin) { + return plugin.getArenaMaster().getArenas().stream() + .anyMatch(arena -> arena.getSettings().getBoolean("monster-infight", false)); + } + +} diff --git a/src/main/java/com/garbagemule/MobArena/metrics/PvpEnabledChart.java b/src/main/java/com/garbagemule/MobArena/metrics/PvpEnabledChart.java new file mode 100644 index 0000000..a409fe1 --- /dev/null +++ b/src/main/java/com/garbagemule/MobArena/metrics/PvpEnabledChart.java @@ -0,0 +1,17 @@ +package com.garbagemule.MobArena.metrics; + +import com.garbagemule.MobArena.MobArena; +import org.bstats.bukkit.Metrics; + +public class PvpEnabledChart extends Metrics.SimplePie { + + public PvpEnabledChart(MobArena plugin) { + super("pvp_enabled_pie", () -> hasPvpEnabled(plugin) ? "Yes" : "No"); + } + + private static boolean hasPvpEnabled(MobArena plugin) { + return plugin.getArenaMaster().getArenas().stream() + .anyMatch(arena -> arena.getSettings().getBoolean("pvp-enabled", false)); + } + +}