From 6e833a9fe49eb88ef41d035891e6805baa33d4c8 Mon Sep 17 00:00:00 2001 From: wizjany Date: Thu, 13 Jun 2019 14:35:00 -0400 Subject: [PATCH] Correctly unwrap old CommandExceptions in AsyncCommandBuilder. --- .../com/sk89q/worldedit/command/util/AsyncCommandBuilder.java | 4 ++++ .../worldedit/util/formatting/component/PaginationBox.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/AsyncCommandBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/AsyncCommandBuilder.java index d2f70a006..b01b2f4fd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/AsyncCommandBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/AsyncCommandBuilder.java @@ -20,6 +20,7 @@ package com.sk89q.worldedit.command.util; import com.google.common.base.Strings; +import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; import com.sk89q.worldedit.extension.platform.Actor; @@ -142,6 +143,9 @@ public final class AsyncCommandBuilder { try { if (exceptionConverter != null) { try { + if (orig instanceof com.sk89q.minecraft.util.commands.CommandException) { + throw new CommandExecutionException(orig, ImmutableList.of()); + } exceptionConverter.convert(orig); throw orig; } catch (CommandException converted) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/PaginationBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/PaginationBox.java index 9308d326c..3f9b95267 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/PaginationBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/PaginationBox.java @@ -79,7 +79,7 @@ public abstract class PaginationBox extends MessageBox { public Component create(int page) throws InvalidComponentException { if (page == 1 && getComponentsSize() == 0) { - return getContents().reset().append("There's nothing to see here").create(); + return getContents().reset().append("No results found.").create(); } int pageCount = (int) Math.ceil(getComponentsSize() / (double) componentsPerPage); if (page < 1 || page > pageCount) {