Proguard likes to fuck up my command framework in the build. This error makes it more clear when that happens

This commit is contained in:
Logan Darklock 2019-08-31 07:16:02 -07:00
parent ee71819bb2
commit d54e846f91
No known key found for this signature in database
GPG Key ID: B8C37CEDE1AC60EA
1 changed files with 4 additions and 1 deletions

View File

@ -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 extends IDatatype> T getDatatype(Class<T> 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);
}
}