Update to debugpaste command

This commit is contained in:
MattBDev 2020-03-20 21:12:11 -04:00
parent 91f0e03ab4
commit 2f8c4ab6f2

View File

@ -37,6 +37,7 @@ import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extension.platform.Platform;
import com.sk89q.worldedit.extension.platform.PlatformManager; 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.format.TextColor;
import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import com.sk89q.worldedit.util.formatting.component.TextComponentProducer; import com.sk89q.worldedit.util.formatting.component.TextComponentProducer;
@ -137,13 +138,15 @@ public class WorldEditCommands {
) )
@CommandPermissions(value = {"worldedit.report", "worldedit.debugpaste"}, queued = false) @CommandPermissions(value = {"worldedit.report", "worldedit.debugpaste"}, queued = false)
public void report(Actor actor) throws WorldEditException { public void report(Actor actor) throws WorldEditException {
String dest = ""; String dest;
try { try {
dest = IncendoPaster.debugPaste(); dest = IncendoPaster.debugPaste();
} catch (IOException e) { } catch (IOException e) {
actor.printInfo(TextComponent.of(e.getMessage())); 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( @Command(