Enhance debugpaste information

This commit is contained in:
N0tMyFaultOG 2020-10-04 16:52:43 +02:00
parent 3a5cfdc357
commit 9f232a9690
2 changed files with 17 additions and 8 deletions

View File

@ -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();
}

View File

@ -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");