Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-03 01:50:07 +01:00
Correctly unwrap old CommandExceptions in AsyncCommandBuilder.
Dieser Commit ist enthalten in:
Ursprung
7787f2c15e
Commit
6e833a9fe4
@ -20,6 +20,7 @@
|
|||||||
package com.sk89q.worldedit.command.util;
|
package com.sk89q.worldedit.command.util;
|
||||||
|
|
||||||
import com.google.common.base.Strings;
|
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.ListenableFuture;
|
||||||
import com.google.common.util.concurrent.ListeningExecutorService;
|
import com.google.common.util.concurrent.ListeningExecutorService;
|
||||||
import com.sk89q.worldedit.extension.platform.Actor;
|
import com.sk89q.worldedit.extension.platform.Actor;
|
||||||
@ -142,6 +143,9 @@ public final class AsyncCommandBuilder<T> {
|
|||||||
try {
|
try {
|
||||||
if (exceptionConverter != null) {
|
if (exceptionConverter != null) {
|
||||||
try {
|
try {
|
||||||
|
if (orig instanceof com.sk89q.minecraft.util.commands.CommandException) {
|
||||||
|
throw new CommandExecutionException(orig, ImmutableList.of());
|
||||||
|
}
|
||||||
exceptionConverter.convert(orig);
|
exceptionConverter.convert(orig);
|
||||||
throw orig;
|
throw orig;
|
||||||
} catch (CommandException converted) {
|
} catch (CommandException converted) {
|
||||||
|
@ -79,7 +79,7 @@ public abstract class PaginationBox extends MessageBox {
|
|||||||
|
|
||||||
public Component create(int page) throws InvalidComponentException {
|
public Component create(int page) throws InvalidComponentException {
|
||||||
if (page == 1 && getComponentsSize() == 0) {
|
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);
|
int pageCount = (int) Math.ceil(getComponentsSize() / (double) componentsPerPage);
|
||||||
if (page < 1 || page > pageCount) {
|
if (page < 1 || page > pageCount) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren