From b65f3ce1f833d0147414a50ee06a3a63786f5126 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Tue, 7 Feb 2023 10:47:49 +0100 Subject: [PATCH] Add metrics for Residence (#2081) --- gradle/libs.versions.toml | 4 ---- worldedit-bukkit/build.gradle.kts | 1 - .../java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java | 7 +++++-- worldedit-core/build.gradle.kts | 1 - 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9a442bd1a..f85477375 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,10 +10,8 @@ worldguard-bukkit = "7.0.7" mapmanager = "1.8.0-SNAPSHOT" griefprevention = "16.18" griefdefender = "2.1.0-SNAPSHOT" -mcore = "7.0.1" residence = "4.5._13.1" towny = "0.98.4.18" -redprotect = "1.9.6" # Third party bstats = "3.0.0" @@ -55,10 +53,8 @@ worldguard = { group = "com.sk89q.worldguard", name = "worldguard-bukkit", versi mapmanager = { group = "com.github.InventivetalentDev", name = "MapManager", version.ref = "mapmanager" } griefprevention = { group = "com.github.TechFortress", name = "GriefPrevention", version.ref = "griefprevention" } griefdefender = { group = "com.griefdefender", name = "api", version.ref = "griefdefender" } -mcore = { group = "com.massivecraft", name = "mcore", version.ref = "mcore" } residence = { group = "com.bekvon.bukkit.residence", name = "Residence", version.ref = "residence" } towny = { group = "com.github.TownyAdvanced", name = "Towny", version.ref = "towny" } -redprotect = { group = "net.fabiozumbi12", name = "redprotect", version.ref = "redprotect" } # Third Party bstatsBase = { group = "org.bstats", name = "bstats-base", version.ref = "bstats" } diff --git a/worldedit-bukkit/build.gradle.kts b/worldedit-bukkit/build.gradle.kts index d3b3c5f22..19e42acb5 100644 --- a/worldedit-bukkit/build.gradle.kts +++ b/worldedit-bukkit/build.gradle.kts @@ -89,7 +89,6 @@ dependencies { compileOnly(libs.mapmanager) { isTransitive = false } compileOnly(libs.griefprevention) { isTransitive = false } compileOnly(libs.griefdefender) { isTransitive = false } - compileOnly(libs.mcore) { isTransitive = false } compileOnly(libs.residence) { isTransitive = false } compileOnly(libs.towny) { isTransitive = false } compileOnly("com.plotsquared:PlotSquared-Bukkit") { isTransitive = false } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index f35891656..66bff5930 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -23,6 +23,7 @@ import com.fastasyncworldedit.bukkit.BukkitPermissionAttachmentManager; import com.fastasyncworldedit.bukkit.FaweBukkit; import com.fastasyncworldedit.core.util.UpdateNotification; import com.fastasyncworldedit.core.Fawe; +import com.fastasyncworldedit.core.util.WEManager; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableList; import com.sk89q.bukkit.util.ClassSourceValidator; @@ -58,6 +59,7 @@ import com.sk89q.worldedit.world.weather.WeatherTypes; import io.papermc.lib.PaperLib; import org.apache.logging.log4j.Logger; import org.bstats.bukkit.Metrics; +import org.bstats.charts.SimplePie; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.NamespacedKey; @@ -220,8 +222,9 @@ public class WorldEditPlugin extends JavaPlugin { } // Enable metrics - new Metrics(this, BSTATS_ID); - + Metrics m = new Metrics(this, BSTATS_ID); + m.addCustomChart(new SimplePie("residence", () + -> WEManager.weManager().getManagers().toString().contains("residence") ? "Yes" : "No")); // Check if we are in a safe environment ServerLib.checkUnsafeForks(); // Check if a new build is available diff --git a/worldedit-core/build.gradle.kts b/worldedit-core/build.gradle.kts index a5d40bb13..21ccaa0b8 100644 --- a/worldedit-core/build.gradle.kts +++ b/worldedit-core/build.gradle.kts @@ -34,7 +34,6 @@ dependencies { implementation("org.apache.logging.log4j:log4j-api") // Plugins - compileOnly(libs.redprotect) { isTransitive = false } compileOnly("com.plotsquared:PlotSquared-Core") { isTransitive = false } // ensure this is on the classpath for the AP