Remove report system

This commit is contained in:
NotMyFault 2019-04-13 12:18:03 +02:00
parent f9f6aead0f
commit c4dc39edbf

View File

@ -124,30 +124,30 @@ public class WorldEditCommands {
actor.print(BBC.getPrefix() + "Reloaded WorldEdit " + we.getVersion() + " and FAWE (" + Fawe.get().getVersion() + ")"); actor.print(BBC.getPrefix() + "Reloaded WorldEdit " + we.getVersion() + " and FAWE (" + Fawe.get().getVersion() + ")");
} }
@Command(aliases = {"report"}, desc = "Writes a report on WorldEdit", flags = "p", max = 0) // @Command(aliases = {"report"}, desc = "Writes a report on WorldEdit", flags = "p", max = 0)
@CommandPermissions({"worldedit.report"}) // @CommandPermissions({"worldedit.report"})
public void report(Actor actor, CommandContext args) throws WorldEditException { // public void report(Actor actor, CommandContext args) throws WorldEditException {
ReportList report = new ReportList("Report"); // ReportList report = new ReportList("Report");
report.add(new SystemInfoReport()); // report.add(new SystemInfoReport());
report.add(new ConfigReport()); // report.add(new ConfigReport());
String result = report.toString(); // String result = report.toString();
//
try { // try {
File dest = new File(we.getWorkingDirectoryFile(we.getConfiguration().saveDir), "report.txt"); // File dest = new File(we.getWorkingDirectoryFile(we.getConfiguration().saveDir), "report.txt");
Files.write(result, dest, Charset.forName("UTF-8")); // Files.write(result, dest, Charset.forName("UTF-8"));
actor.print("WorldEdit report written to " + dest.getAbsolutePath()); // actor.print("WorldEdit report written to " + dest.getAbsolutePath());
} catch (IOException e) { // } catch (IOException e) {
actor.printError("Failed to write report: " + e.getMessage()); // actor.printError("Failed to write report: " + e.getMessage());
} // }
//
if (args.hasFlag('p')) { // if (args.hasFlag('p')) {
actor.checkPermission("worldedit.report.pastebin"); // actor.checkPermission("worldedit.report.pastebin");
ActorCallbackPaste.pastebin( // ActorCallbackPaste.pastebin(
we.getSupervisor(), actor, result, "WorldEdit report: %s.report", // we.getSupervisor(), actor, result, "WorldEdit report: %s.report",
WorldEdit.getInstance().getPlatformManager().getCommandManager().getExceptionConverter() // WorldEdit.getInstance().getPlatformManager().getCommandManager().getExceptionConverter()
); // );
} // }
} // }
@Command( @Command(
aliases = {"update"}, aliases = {"update"},
@ -248,28 +248,6 @@ public class WorldEditCommands {
} }
} }
// @Command(aliases = {"report"}, desc = "Writes a report on WorldEdit", flags = "p", max = 0)
// @CommandPermissions({"worldedit.report"})
// public void report(Actor actor, CommandContext args) throws WorldEditException {
// ReportList report = new ReportList("Report");
// report.add(new SystemInfoReport());
// report.add(new ConfigReport());
// String result = report.toString();
//
// try {
// File dest = new File(we.getWorkingDirectoryFile(we.getConfiguration().saveDir), "report.txt");
// Files.write(result, dest, Charset.forName("UTF-8"));
// actor.print("WorldEdit report written to " + dest.getAbsolutePath());
// } catch (IOException e) {
// actor.printError("Failed to write report: " + e.getMessage());
// }
//
// if (args.hasFlag('p')) {
// actor.checkPermission("worldedit.report.pastebin");
// ActorCallbackPaste.pastebin(we.getSupervisor(), actor, result, "WorldEdit report: %s.report");
// }
// }
@Command( @Command(
aliases = {"cui"}, aliases = {"cui"},
usage = "", usage = "",