Correctly unwrap old CommandExceptions in AsyncCommandBuilder.

Dieser Commit ist enthalten in:
wizjany 2019-06-13 14:35:00 -04:00
Ursprung 7787f2c15e
Commit 6e833a9fe4
2 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -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<T> {
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) {

Datei anzeigen

@ -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) {