Backport debugpaste order

Also add dependency check for NukkitX.
This commit is contained in:
NotMyFault 2019-07-25 22:32:38 +02:00
parent 5cc5ce5537
commit 58243b6757
3 changed files with 15 additions and 11 deletions

View File

@ -348,8 +348,8 @@ public class FaweBukkit implements IFawe, Listener {
public String getDebugInfo() { public String getDebugInfo() {
StringBuilder msg = new StringBuilder(); StringBuilder msg = new StringBuilder();
List<String> pl = new ArrayList<>(); List<String> pl = new ArrayList<>();
msg.append("server.version: " + Bukkit.getVersion() + " / " + Bukkit.getBukkitVersion() + "\n"); msg.append("Server Version: " + Bukkit.getVersion() + "\n");
msg.append("server.plugins: \n"); msg.append("Plugins: \n");
for (Plugin p : Bukkit.getPluginManager().getPlugins()) { for (Plugin p : Bukkit.getPluginManager().getPlugins()) {
msg.append(" - " + p.getName() + ": " + p.getDescription().getVersion() + "\n"); msg.append(" - " + p.getName() + ": " + p.getDescription().getVersion() + "\n");
} }

View File

@ -6,6 +6,8 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;
import java.io.*; import java.io.*;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.net.URLConnection; import java.net.URLConnection;
@ -197,14 +199,15 @@ public final class IncendoPaster {
b.append(Fawe.imp().getDebugInfo()).append('\n'); b.append(Fawe.imp().getDebugInfo()).append('\n');
b.append("\n\n# YAY! Now, let's see what we can find in your JVM\n"); b.append("\n\n# YAY! Now, let's see what we can find in your JVM\n");
Runtime runtime = Runtime.getRuntime(); Runtime runtime = Runtime.getRuntime();
b.append("memory.free: ").append(runtime.freeMemory()).append('\n'); RuntimeMXBean rb = ManagementFactory.getRuntimeMXBean();
b.append("memory.max: ").append(runtime.maxMemory()).append('\n'); b.append("Free Memory: ").append(runtime.freeMemory() / 1024 / 1024 + " MB").append('\n');
b.append("java.specification.version: '").append(System.getProperty("java.specification.version")).append("'\n"); b.append("Max Memory: ").append(runtime.maxMemory() / 1024 / 1024 + " MB").append('\n');
b.append("java.vendor: '").append(System.getProperty("java.vendor")).append("'\n"); b.append("Java Name: ").append(rb.getVmName()).append('\n');
b.append("java.version: '").append(System.getProperty("java.version")).append("'\n"); b.append("Java Version: '").append(System.getProperty("java.version")).append("'\n");
b.append("os.arch: '").append(System.getProperty("os.arch")).append("'\n"); b.append("Java Vendor: '").append(System.getProperty("java.vendor")).append("'\n");
b.append("os.name: '").append(System.getProperty("os.name")).append("'\n"); b.append("Operating System: '").append(System.getProperty("os.name")).append("'\n");
b.append("os.version: '").append(System.getProperty("os.version")).append("'\n\n"); b.append("OS Version: ").append(System.getProperty("os.version")).append('\n');
b.append("OS Arch: ").append(System.getProperty("os.arch")).append('\n');
b.append("# Okay :D Great. You are now ready to create your bug report!"); b.append("# Okay :D Great. You are now ready to create your bug report!");
b.append("\n# You can do so at https://github.com/boy0001/FastAsyncWorldedit/issues"); b.append("\n# You can do so at https://github.com/boy0001/FastAsyncWorldedit/issues");
b.append("\n# or via our Discord at https://discord.gg/ngZCzbU"); b.append("\n# or via our Discord at https://discord.gg/ngZCzbU");
@ -214,7 +217,7 @@ public final class IncendoPaster {
final File logFile = new File(Fawe.imp().getDirectory(), "../../logs/latest.log"); final File logFile = new File(Fawe.imp().getDirectory(), "../../logs/latest.log");
final String file; final String file;
if (Files.size(logFile.toPath()) > 14_000_000) { if (Files.size(logFile.toPath()) > 14_000_000) {
file = "too big :("; file = "Too big ...";
} else { } else {
file = readFile(logFile); file = readFile(logFile);
} }

View File

@ -2,6 +2,7 @@ name: "${name}"
version: "${version}" version: "${version}"
author: Empire92 author: Empire92
api: ["1.0.0"] api: ["1.0.0"]
depend: [DbLib]
main: com.boydti.fawe.nukkit.core.NukkitWorldEdit main: com.boydti.fawe.nukkit.core.NukkitWorldEdit
permissions: permissions:
fawe.plotsquared: fawe.plotsquared: