Upstream has released updates that appear to apply and compile correctly. [Purpur Changes] PurpurMC/Purpur@e86a1b6: Updated Upstream (Paper) PurpurMC/Purpur@962ee30: Updated Upstream (Paper) PurpurMC/Purpur@74d1b4c: Updated Upstream (Paper) PurpurMC/Purpur@e2e8c61: Updated Upstream (Paper) PurpurMC/Purpur@7a01fd8: Updated Upstream (Paper) PurpurMC/Purpur@34c18f0: Updated Upstream (Paper) PurpurMC/Purpur@ca668ab: Updated Upstream (Paper) PurpurMC/Purpur@200178d: Updated Upstream (Paper) PurpurMC/Purpur@9968cbb: Updated Upstream (Paper) PurpurMC/Purpur@db09358: Fix clamp-levels option not being true by default (#1609) PurpurMC/Purpur@f289b6a: Updated Upstream (Paper) PurpurMC/Purpur@959c29d: Fix Tridents giving errors without having an Elytra equipped (#1612) PurpurMC/Purpur@68c1612: Fix villagers not spawning when the `follow-emerald-blocks` option is enabled (#1611) PurpurMC/Purpur@5b75c68: fix `bypass-mob-griefing` not being the inverse of mobgriefing gamerule, closes #1603 PurpurMC/Purpur@55d4309: Updated Upstream (Paper) PurpurMC/Purpur@0601f87: Updated Upstream (Paper) PurpurMC/Purpur@06dde9d: Add Ridable and Attribute options for Creaking mob (#1613) PurpurMC/Purpur@420a1ce: Set the bee's `takes-damage-from-water` option to true by default (#1614) PurpurMC/Purpur@2b6f273: Updated Upstream (Paper) PurpurMC/Purpur@504f311: Updated Upstream (Paper) PurpurMC/Purpur@2b694c9: Updated Upstream (Paper) PurpurMC/Purpur@96d7ef7: Updated Upstream (Paper) PurpurMC/Purpur@e141f68: Updated Upstream (Paper) PurpurMC/Purpur@7f6f667: Updated Upstream (Pufferfish) PurpurMC/Purpur@de20ba9: ignore `minecart.max-speed` config value if using minecart experiment, closes #1618 PurpurMC/Purpur@03062a8: fix ridable mobs not being controllable, closes #1620 PurpurMC/Purpur@0493ac3: Updated Upstream (Paper) PurpurMC/Purpur@16ce24a: fix(ridables/creaking): override tick method in look/move control
99 lines
6.1 KiB
Diff
99 lines
6.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: AlphaKR93 <dev@alpha93.kr>
|
|
Date: Sun, 5 Nov 2023 10:26:26 +0900
|
|
Subject: [PATCH] Add more metrics
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
|
index 8d5a52c5762c3d9b44dcdf00ae312e0bdc01fa1f..48d33d4131af90eee35c9553898a2ac7ec5e2b7e 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
|
@@ -636,38 +636,59 @@ public class Metrics {
|
|
return map;
|
|
}));
|
|
|
|
- metrics.addCustomChart(new Metrics.DrilldownPie("legacy_plugins", () -> {
|
|
- Map<String, Map<String, Integer>> map = new HashMap<>();
|
|
+ // Plazma start - Add more metrics information
|
|
+ metrics.addCustomChart(new DrilldownPie("datapacks", () -> {
|
|
+ int datapacks = Bukkit.getDatapackManager().getEnabledPacks().size();
|
|
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(datapacks), 1);
|
|
+
|
|
+ if (datapacks == 0) return Collections.singletonMap("0", entry);
|
|
+ else if (datapacks <= 5) return Collections.singletonMap("1-5", entry);
|
|
+ else if (datapacks <= 10) return Collections.singletonMap("6-10", entry);
|
|
+ else if (datapacks <= 25) return Collections.singletonMap("11-25", entry);
|
|
+ else if (datapacks <= 50) return Collections.singletonMap("26-50", entry);
|
|
+ else if (datapacks <= 100) return Collections.singletonMap("51+", entry);
|
|
+ else return Collections.singletonMap("101+ \uD83D\uDE2E", entry);
|
|
+ }));
|
|
|
|
- // count legacy plugins
|
|
- int legacy = 0;
|
|
- for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
|
|
- if (CraftMagicNumbers.isLegacy(plugin.getDescription())) {
|
|
- legacy++;
|
|
- }
|
|
- }
|
|
+ metrics.addCustomChart(new DrilldownPie("plugins", () -> {
|
|
+ int pluginCount = Arrays.stream(Bukkit.getPluginManager().getPlugins()).filter(Plugin::isEnabled).toList().size();
|
|
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(pluginCount), 1);
|
|
+
|
|
+ if (pluginCount == 0) return Collections.singletonMap("0", entry);
|
|
+ else if (pluginCount <= 5) return Collections.singletonMap("1-5", entry);
|
|
+ else if (pluginCount <= 10) return Collections.singletonMap("6-10", entry);
|
|
+ else if (pluginCount <= 25) return Collections.singletonMap("11-25", entry);
|
|
+ else if (pluginCount <= 50) return Collections.singletonMap("26-50", entry);
|
|
+ else if (pluginCount <= 100) return Collections.singletonMap("51-100", entry);
|
|
+ else return Collections.singletonMap("101+ \uD83D\uDE2E", entry);
|
|
+ }));
|
|
|
|
- // insert real value as lower dimension
|
|
- Map<String, Integer> entry = new HashMap<>();
|
|
- entry.put(String.valueOf(legacy), 1);
|
|
-
|
|
- // create buckets as higher dimension
|
|
- if (legacy == 0) {
|
|
- map.put("0 \uD83D\uDE0E", entry); // :sunglasses:
|
|
- } else if (legacy <= 5) {
|
|
- map.put("1-5", entry);
|
|
- } else if (legacy <= 10) {
|
|
- map.put("6-10", entry);
|
|
- } else if (legacy <= 25) {
|
|
- map.put("11-25", entry);
|
|
- } else if (legacy <= 50) {
|
|
- map.put("26-50", entry);
|
|
- } else {
|
|
- map.put("50+ \uD83D\uDE2D", entry); // :cry:
|
|
- }
|
|
+ metrics.addCustomChart(new DrilldownPie("disabled_plugins", () -> {
|
|
+ int disabled = Arrays.stream(Bukkit.getPluginManager().getPlugins()).filter(it -> !it.isEnabled()).toList().size();
|
|
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(disabled), 1);
|
|
+
|
|
+ if (disabled == 0) return Collections.singletonMap("0 \uD83D\uDE0E", entry); // :sunglasses:
|
|
+ else if (disabled <= 5) return Collections.singletonMap("1-5", entry);
|
|
+ else if (disabled <= 10) return Collections.singletonMap("6-10", entry);
|
|
+ else if (disabled <= 25) return Collections.singletonMap("11-25", entry);
|
|
+ else if (disabled <= 50) return Collections.singletonMap("26-50", entry);
|
|
+ else if (disabled <= 100) return Collections.singletonMap("51-100 \uD83D\uDE2D", entry); // :cry:
|
|
+ else return Collections.singletonMap("101+ \uD83D\uDC80", entry); // :skull:
|
|
+ }));
|
|
|
|
- return map;
|
|
+ metrics.addCustomChart(new Metrics.DrilldownPie("legacy_plugins", () -> {
|
|
+ int legacy = (int) Arrays.stream(Bukkit.getPluginManager().getPlugins()).filter(p -> CraftMagicNumbers.isLegacy(p.getDescription())).count(); // Plazma
|
|
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(legacy), 1);
|
|
+
|
|
+ if (legacy == 0) return Collections.singletonMap("0 \uD83D\uDE0E", entry); // :sunglasses:
|
|
+ else if (legacy <= 5) return Collections.singletonMap("1-5", entry);
|
|
+ else if (legacy <= 10) return Collections.singletonMap("6-10", entry);
|
|
+ else if (legacy <= 25) return Collections.singletonMap("11-25", entry);
|
|
+ else if (legacy <= 50) return Collections.singletonMap("26-50", entry);
|
|
+ else if (legacy <= 100) return Collections.singletonMap("51-100 \uD83D\uDE2D", entry); // :cry:
|
|
+ else return Collections.singletonMap("101+ \uD83D\uDC80", entry); // :skull:
|
|
}));
|
|
+ // Plazma end - Add more metrics information
|
|
}
|
|
|
|
}
|