From 2f8c4ab6f2816f3d5816ff5e33573e6438d6aa4e Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Fri, 20 Mar 2020 21:12:11 -0400 Subject: [PATCH] Update to debugpaste command --- .../com/sk89q/worldedit/command/WorldEditCommands.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java index 615677488..7ba1c651c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java @@ -37,6 +37,7 @@ 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.formatting.text.event.ClickEvent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.component.TextComponentProducer; @@ -137,13 +138,15 @@ public class WorldEditCommands { ) @CommandPermissions(value = {"worldedit.report", "worldedit.debugpaste"}, queued = false) public void report(Actor actor) throws WorldEditException { - String dest = ""; + String dest; try { dest = IncendoPaster.debugPaste(); } catch (IOException e) { actor.printInfo(TextComponent.of(e.getMessage())); + return; } - actor.printInfo(TranslatableComponent.of("worldedit.report.written", TextComponent.of(dest))); + actor.printInfo(TranslatableComponent.of("worldedit.report.written", TextComponent.of(dest).clickEvent( + ClickEvent.openUrl(dest)))); } @Command(