From 9f232a969025dabe4c5050e89d3c1b401e05f36f Mon Sep 17 00:00:00 2001 From: N0tMyFaultOG Date: Sun, 4 Oct 2020 16:52:43 +0200 Subject: [PATCH] Enhance debugpaste information --- .../java/com/boydti/fawe/bukkit/FaweBukkit.java | 16 ++++++++++++---- .../java/com/boydti/fawe/util/IncendoPaster.java | 9 +++++---- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java index 1f58e55ff..fd110b2e3 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java @@ -171,11 +171,19 @@ public class FaweBukkit implements IFawe, Listener { @Override public String getDebugInfo() { StringBuilder msg = new StringBuilder(); + Plugin[] plugins = Bukkit.getServer().getPluginManager().getPlugins(); msg.append("Server Version: ").append(Bukkit.getVersion()).append("\n"); - msg.append("Plugins: \n"); - for (Plugin p : Bukkit.getPluginManager().getPlugins()) { - msg.append(" - ").append(p.getName()).append(": ") - .append(p.getDescription().getVersion()).append("\n"); + msg.append("Plugins (").append(plugins.length).append("): \n"); + for (Plugin p : plugins) { + msg.append(" - ").append(p.getName()).append(":").append("\n") + .append(" • Version: ").append(p.getDescription().getVersion()).append("\n") + .append(" • Enabled: ").append(p.isEnabled()).append("\n") + .append(" • Main: ").append(p.getDescription().getMain()).append("\n") + .append(" • Authors: ").append(p.getDescription().getAuthors()).append("\n") + .append(" • Load Before: ").append(p.getDescription().getLoadBefore()).append("\n") + .append(" • Dependencies: ").append(p.getDescription().getDepend()).append("\n") + .append(" • Soft Dependencies: ").append(p.getDescription().getSoftDepend()).append("\n") + .append(" • Provides: ").append(p.getDescription().getProvides()).append("\n"); } return msg.toString(); } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/util/IncendoPaster.java b/worldedit-core/src/main/java/com/boydti/fawe/util/IncendoPaster.java index c97fa0e3d..fdb0a06f9 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/util/IncendoPaster.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/util/IncendoPaster.java @@ -230,10 +230,11 @@ public final class IncendoPaster implements Paster { b.append("\n# YAY! Now, let's see what we can find in your JVM\n"); Runtime runtime = Runtime.getRuntime(); RuntimeMXBean rb = ManagementFactory.getRuntimeMXBean(); - b.append("Uptime: ").append(TimeUnit.MINUTES.convert(rb.getUptime(), TimeUnit.MILLISECONDS) + " minutes").append('\n'); - b.append("Free Memory: ").append(runtime.freeMemory() / 1024 / 1024 + " MB").append('\n'); - b.append("Max Memory: ").append(runtime.maxMemory() / 1024 / 1024 + " MB").append('\n'); - b.append("Total Memory: ").append(runtime.totalMemory() / 1024 / 1024 + " MB").append('\n'); + b.append("Uptime: ").append(TimeUnit.MINUTES.convert(rb.getUptime(), TimeUnit.MILLISECONDS)) + .append(" minutes").append('\n'); + b.append("Free Memory: ").append(runtime.freeMemory() / 1024 / 1024).append(" MB").append('\n'); + b.append("Max Memory: ").append(runtime.maxMemory() / 1024 / 1024).append(" MB").append('\n'); + b.append("Total Memory: ").append(runtime.totalMemory() / 1024 / 1024).append(" MB").append('\n'); b.append("Available Processors: ").append(runtime.availableProcessors()).append('\n'); b.append("Java Name: ").append(rb.getVmName()).append('\n'); b.append("Java Version: '").append(System.getProperty("java.version")).append("'\n");