mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-03 03:46:42 +00:00
Move the pasting system over to WorldEdit, and add a /we report command. Currently only reports system status and the config. Need to add a platform reporter system.
This commit is contained in:
committed by
IronApollo
parent
54142c8669
commit
45f1de6009
@ -28,6 +28,7 @@ import com.boydti.fawe.util.HastebinUtility;
|
||||
import com.boydti.fawe.util.StringMan;
|
||||
import com.boydti.fawe.util.TaskManager;
|
||||
import com.boydti.fawe.util.Updater;
|
||||
import com.google.common.io.Files;
|
||||
import com.sk89q.minecraft.util.commands.Command;
|
||||
import com.sk89q.minecraft.util.commands.CommandContext;
|
||||
import com.sk89q.minecraft.util.commands.CommandPermissions;
|
||||
@ -40,6 +41,18 @@ import com.sk89q.worldedit.extension.platform.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.Capability;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
import com.sk89q.worldedit.extension.platform.PlatformManager;
|
||||
import com.sk89q.worldedit.util.paste.ActorCallbackPaste;
|
||||
import com.sk89q.worldedit.util.report.ConfigReport;
|
||||
import com.sk89q.worldedit.util.report.ReportList;
|
||||
import com.sk89q.worldedit.util.report.SystemInfoReport;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
@ -189,7 +202,8 @@ public class WorldEditCommands {
|
||||
)
|
||||
@CommandPermissions("worldedit.debugpaste")
|
||||
public void debugpaste(Actor actor) throws WorldEditException, IOException {
|
||||
BBC.DOWNLOAD_LINK.send(actor, HastebinUtility.debugPaste());
|
||||
// BBC.DOWNLOAD_LINK.send(actor, HastebinUtility.debugPaste());
|
||||
ActorCallbackPaste.pastebin(we.getSupervisor(), actor, null, "FastAsyncWorldEdit report: " + BBC.DOWNLOAD_LINK);
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -213,6 +227,28 @@ 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(
|
||||
aliases = {"cui"},
|
||||
usage = "",
|
||||
|
Reference in New Issue
Block a user