mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-03 03:46:42 +00:00
Merge remote-tracking branch 'upstream/master' into breaking
This commit is contained in:
@ -124,6 +124,31 @@ public class WorldEditCommands {
|
||||
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)
|
||||
@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",
|
||||
WorldEdit.getInstance().getPlatformManager().getCommandManager().getExceptionConverter()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = {"update"},
|
||||
usage = "",
|
||||
@ -252,7 +277,7 @@ public class WorldEditCommands {
|
||||
min = 0,
|
||||
max = 0
|
||||
)
|
||||
public void cui(Player player, LocalSession session, CommandContext args) throws WorldEditException {
|
||||
public void cui(Player player, LocalSession session) throws WorldEditException {
|
||||
session.setCUISupport(true);
|
||||
session.dispatchCUISetup(player);
|
||||
}
|
||||
|
Reference in New Issue
Block a user