From d54e846f917b257a57b922c4d2c6dbf11dae7c75 Mon Sep 17 00:00:00 2001 From: Logan Darklock Date: Sat, 31 Aug 2019 07:16:02 -0700 Subject: [PATCH] Proguard likes to fuck up my command framework in the build. This error makes it more clear when that happens --- .../api/utils/command/helpers/arguments/ArgConsumer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api/java/baritone/api/utils/command/helpers/arguments/ArgConsumer.java b/src/api/java/baritone/api/utils/command/helpers/arguments/ArgConsumer.java index 8f6b91f0..e050239c 100644 --- a/src/api/java/baritone/api/utils/command/helpers/arguments/ArgConsumer.java +++ b/src/api/java/baritone/api/utils/command/helpers/arguments/ArgConsumer.java @@ -25,6 +25,7 @@ import baritone.api.utils.command.exception.CommandException; import baritone.api.utils.command.exception.CommandInvalidTypeException; import baritone.api.utils.command.exception.CommandNotEnoughArgumentsException; import baritone.api.utils.command.exception.CommandTooManyArgumentsException; +import baritone.api.utils.command.exception.CommandUnhandledException; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; @@ -213,8 +214,10 @@ public class ArgConsumer { public T getDatatype(Class datatype) { try { return datatype.getConstructor(ArgConsumer.class).newInstance(this); - } catch (RuntimeException | NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { + } catch (RuntimeException e) { throw new CommandInvalidTypeException(has() ? peek() : consumed(), datatype.getSimpleName()); + } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { + throw new CommandUnhandledException(e); } }