From c53e8d62206759920eb971a24b6b6f0b1284ee5f Mon Sep 17 00:00:00 2001 From: Professor Bloodstone Date: Tue, 25 Aug 2020 22:34:46 +0200 Subject: [PATCH] Add summary to /paper chunkinfo command --- .../Chunk-debug-command.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Spigot-Server-Patches/Chunk-debug-command.patch b/Spigot-Server-Patches/Chunk-debug-command.patch index e34f2dc066..2fdb724f2c 100644 --- a/Spigot-Server-Patches/Chunk-debug-command.patch +++ b/Spigot-Server-Patches/Chunk-debug-command.patch @@ -107,6 +107,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } + ++ int accumulatedTotal = 0; ++ int accumulatedInactive = 0; ++ int accumulatedBorder = 0; ++ int accumulatedTicking = 0; ++ int accumulatedEntityTicking = 0; ++ + for (org.bukkit.World bukkitWorld : worlds) { + WorldServer world = ((CraftWorld)bukkitWorld).getHandle(); + @@ -141,11 +147,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } + ++ accumulatedTotal += total; ++ accumulatedInactive += inactive; ++ accumulatedBorder += border; ++ accumulatedTicking += ticking; ++ accumulatedEntityTicking += entityTicking; ++ + sender.sendMessage(ChatColor.BLUE + "Chunks in " + ChatColor.GREEN + bukkitWorld.getName() + ChatColor.DARK_AQUA + ":"); + sender.sendMessage(ChatColor.BLUE + "Total: " + ChatColor.DARK_AQUA + total + ChatColor.BLUE + " Inactive: " + ChatColor.DARK_AQUA + + inactive + ChatColor.BLUE + " Border: " + ChatColor.DARK_AQUA + border + ChatColor.BLUE + " Ticking: " + + ChatColor.DARK_AQUA + ticking + ChatColor.BLUE + " Entity: " + ChatColor.DARK_AQUA + entityTicking); + } ++ if (worlds.size() > 1) { ++ sender.sendMessage(ChatColor.BLUE + "Chunks in " + ChatColor.GREEN + "all listed worlds" + ChatColor.DARK_AQUA + ":"); ++ sender.sendMessage(ChatColor.BLUE + "Total: " + ChatColor.DARK_AQUA + accumulatedTotal + ChatColor.BLUE + " Inactive: " + ChatColor.DARK_AQUA ++ + accumulatedInactive + ChatColor.BLUE + " Border: " + ChatColor.DARK_AQUA + accumulatedBorder + ChatColor.BLUE + " Ticking: " ++ + ChatColor.DARK_AQUA + accumulatedTicking + ChatColor.BLUE + " Entity: " + ChatColor.DARK_AQUA + accumulatedEntityTicking); ++ } + } + + private void doDebug(CommandSender sender, String[] args) {