From 6c8aa256f6be56d66c7c544a519172dfc6a68db4 Mon Sep 17 00:00:00 2001 From: Dueris MC Date: Thu, 2 Nov 2023 02:16:17 +0000 Subject: [PATCH] Fix bstats metrics --- Canvas-API | 2 +- Canvas-Server | 2 +- .../server/0036-Fix-Metrics-for-bstats.patch | 28 +++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 patches/server/0036-Fix-Metrics-for-bstats.patch diff --git a/Canvas-API b/Canvas-API index 756a4a9..4fc9895 160000 --- a/Canvas-API +++ b/Canvas-API @@ -1 +1 @@ -Subproject commit 756a4a954ff5f210557c1f5e97cbbf0a3f8696d5 +Subproject commit 4fc98953fba108dff504baa5f55dca1a3336aa2b diff --git a/Canvas-Server b/Canvas-Server index 0231ab3..af38522 160000 --- a/Canvas-Server +++ b/Canvas-Server @@ -1 +1 @@ -Subproject commit 0231ab3bae67096f4fb5f8bff020e85c9a78a7a3 +Subproject commit af38522dceafbb71e98c702790e9a74919168dc8 diff --git a/patches/server/0036-Fix-Metrics-for-bstats.patch b/patches/server/0036-Fix-Metrics-for-bstats.patch new file mode 100644 index 0000000..81e0874 --- /dev/null +++ b/patches/server/0036-Fix-Metrics-for-bstats.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dueris MC +Date: Thu, 2 Nov 2023 02:14:27 +0000 +Subject: [PATCH] Fix Metrics for bstats + + +diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java +index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..a186dea733a8db43c429a67a6dbb66121b8f1b8c 100644 +--- a/src/main/java/com/destroystokyo/paper/Metrics.java ++++ b/src/main/java/com/destroystokyo/paper/Metrics.java +@@ -593,7 +593,7 @@ public class Metrics { + boolean logFailedRequests = config.getBoolean("logFailedRequests", false); + // Only start Metrics, if it's enabled in the config + if (config.getBoolean("enabled", true)) { +- Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur ++ Metrics metrics = new Metrics("Canvas", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur // Canvas + + metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { + String minecraftVersion = Bukkit.getVersion(); +@@ -603,7 +603,7 @@ public class Metrics { + + metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size())); + metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur +- metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur ++ metrics.addCustomChart(new Metrics.SimplePie("canvas_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur // Canvas + + metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { + Map> map = new HashMap<>();