From ec3648e521d00d1ca9a6f0d10783d754ac44eaef Mon Sep 17 00:00:00 2001 From: wizjany Date: Wed, 29 May 2019 21:38:37 -0400 Subject: [PATCH] Wrap and unwrap. Exceptions are fun. --- .../main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java | 2 +- .../internal/command/exception/ExceptionConverterHelper.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index 570ef30be..b53d36b01 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -131,7 +131,7 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { // register this so we can load world-dependent data right as the first world is loading if (worldInitListener != null) { - getLogger().warning("Server reload detected. This may cause various issues with WorldEdit and dependant plugins."); + getLogger().warning("Server reload detected. This may cause various issues with WorldEdit and dependent plugins."); try { // these don't stick around between reload loadAdapter(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/exception/ExceptionConverterHelper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/exception/ExceptionConverterHelper.java index 99a9bce68..42959c5fb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/exception/ExceptionConverterHelper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/exception/ExceptionConverterHelper.java @@ -76,6 +76,9 @@ public abstract class ExceptionConverterHelper implements ExceptionConverter { if (e.getCause() instanceof CommandException) { throw (CommandException) e.getCause(); } + if (e.getCause() instanceof com.sk89q.minecraft.util.commands.CommandException) { + throw new CommandException(e.getCause(), ImmutableList.of()); + } throw new CommandExecutionException(e, ImmutableList.of()); } catch (IllegalArgumentException | IllegalAccessException e) { throw new CommandExecutionException(e, ImmutableList.of());