Update bStats to 2.1.0

This commit is contained in:
NotMyFault 2021-01-24 10:39:03 +01:00
parent 86e8457574
commit aaf2fa8807
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
2 changed files with 10 additions and 13 deletions

View File

@ -6,11 +6,6 @@ repositories {
url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
} }
maven {
name = "CodeMC"
url = uri("https://repo.codemc.org/repository/maven-public")
}
maven { maven {
name = "PlaceholderAPI" name = "PlaceholderAPI"
url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/") url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/")
@ -47,7 +42,7 @@ dependencies {
// //
// Metrics // Metrics
implementation("org.bstats:bstats-bukkit:1.8") implementation("org.bstats:bstats-bukkit:2.1.0")
// Minecraft // Minecraft
compileOnlyApi("com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT") compileOnlyApi("com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT")

View File

@ -123,6 +123,8 @@ import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bstats.bukkit.Metrics; import org.bstats.bukkit.Metrics;
import org.bstats.charts.DrilldownPie;
import org.bstats.charts.SimplePie;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Chunk; import org.bukkit.Chunk;
import org.bukkit.Location; import org.bukkit.Location;
@ -1030,7 +1032,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
} }
this.metricsStarted = true; this.metricsStarted = true;
Metrics metrics = new Metrics(this, BSTATS_ID); // bstats Metrics metrics = new Metrics(this, BSTATS_ID); // bstats
metrics.addCustomChart(new Metrics.DrilldownPie("area_types", () -> { metrics.addCustomChart(new DrilldownPie("area_types", () -> {
final Map<String, Map<String, Integer>> map = new HashMap<>(); final Map<String, Map<String, Integer>> map = new HashMap<>();
for (final PlotAreaType plotAreaType : PlotAreaType.values()) { for (final PlotAreaType plotAreaType : PlotAreaType.values()) {
final Map<String, Integer> terrainTypes = new HashMap<>(); final Map<String, Integer> terrainTypes = new HashMap<>();
@ -1048,18 +1050,18 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
} }
return map; return map;
})); }));
metrics.addCustomChart(new Metrics.SimplePie( metrics.addCustomChart(new SimplePie(
"premium", "premium",
() -> PremiumVerification.isPremium() ? "Premium" : "Non-Premium" () -> PremiumVerification.isPremium() ? "Premium" : "Non-Premium"
)); ));
metrics.addCustomChart(new Metrics.SimplePie("worlds", () -> Settings.Enabled_Components.WORLDS ? "true" : "false")); metrics.addCustomChart(new SimplePie("worlds", () -> Settings.Enabled_Components.WORLDS ? "true" : "false"));
metrics.addCustomChart(new Metrics.SimplePie("economy", () -> Settings.Enabled_Components.ECONOMY ? "true" : "false")); metrics.addCustomChart(new SimplePie("economy", () -> Settings.Enabled_Components.ECONOMY ? "true" : "false"));
metrics.addCustomChart(new Metrics.SimplePie( metrics.addCustomChart(new SimplePie(
"plot_expiry", "plot_expiry",
() -> Settings.Enabled_Components.PLOT_EXPIRY ? "true" : "false" () -> Settings.Enabled_Components.PLOT_EXPIRY ? "true" : "false"
)); ));
metrics.addCustomChart(new Metrics.SimplePie("database_type", () -> Storage.MySQL.USE ? "MySQL" : "SQLite")); metrics.addCustomChart(new SimplePie("database_type", () -> Storage.MySQL.USE ? "MySQL" : "SQLite"));
metrics.addCustomChart(new Metrics.SimplePie( metrics.addCustomChart(new SimplePie(
"worldedit_implementation", "worldedit_implementation",
() -> Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit") != null ? "FastAsyncWorldEdit" : "WorldEdit" () -> Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit") != null ? "FastAsyncWorldEdit" : "WorldEdit"
)); ));