Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Commit

Permalink
Include plugins in Crash Reports
Browse files Browse the repository at this point in the history
  • Loading branch information
sameer committed Feb 6, 2016
1 parent 66e6e56 commit 5d034d1
Showing 1 changed file with 35 additions and 10 deletions.
45 changes: 35 additions & 10 deletions patches/net/minecraft/crash/CrashReport.java.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
--- ../src-base/minecraft/net/minecraft/crash/CrashReport.java
+++ ../src-work/minecraft/net/minecraft/crash/CrashReport.java
@@ -3,6 +3,7 @@
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
@@ -15,8 +16,11 @@
@@ -15,12 +16,18 @@
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Callable;
Expand All @@ -20,7 +12,14 @@
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.logging.log4j.LogManager;
@@ -51,6 +55,12 @@
import org.apache.logging.log4j.Logger;
+import org.bukkit.Bukkit;
+import org.bukkit.ChatColor;
+import org.bukkit.plugin.Plugin;

public class CrashReport
{
@@ -51,6 +58,38 @@
return "1.7.10";
}
});
Expand All @@ -29,6 +28,32 @@
+ public String call() throws Exception {
+ return String.format("%s:%s:%s", Thermos.getGroup(), Thermos.getChannel(), Thermos.getCurrentVersion());
+ }
+ });
+ this.theReportCategory.addCrashSectionCallable("Plugins", new Callable<String>() {
+ @Override
+ public String call() throws Exception {
+ StringBuilder pluginList = new StringBuilder();
+ Plugin[] plugins = Bukkit.getPluginManager().getPlugins();
+ for (Plugin plugin : plugins) {
+ if (pluginList.length() > 0)
+ pluginList.append(", ");
+ if (plugin.isEnabled()) pluginList.append(plugin.getDescription().getName());
+ }
+ return pluginList.toString();
+ }
+ });
+ this.theReportCategory.addCrashSectionCallable("Disabled Plugins", new Callable<String>() {
+ @Override
+ public String call() throws Exception {
+ StringBuilder pluginList = new StringBuilder();
+ Plugin[] plugins = Bukkit.getPluginManager().getPlugins();
+ for (Plugin plugin : plugins) {
+ if (pluginList.length() > 0)
+ pluginList.append(", ");
+ if (!plugin.isEnabled()) pluginList.append(plugin.getDescription().getName());
+ }
+ return pluginList.toString();
+ }
+ });
this.theReportCategory.addCrashSectionCallable("Operating System", new Callable()
{
Expand Down

0 comments on commit 5d034d1

Please sign in to comment.