Told Proguard not to touch things it doesn't understand

This commit is contained in:
Logan Darklock 2019-08-31 07:36:23 -07:00
parent d54e846f91
commit 90fb17b89f
No known key found for this signature in database
GPG Key ID: B8C37CEDE1AC60EA
3 changed files with 8 additions and 2 deletions

View File

@ -17,6 +17,11 @@
-keep class baritone.api.** { *; } # this is the keep api
# Proguard does not know the commands framework better than I do
# It needs its empty constructors and simple names to work correctly
-keep class baritone.api.utils.command.** { *; }
-keepclasseswithmembernames class baritone.api.utils.command.** { *; }
# service provider needs these class names
-keep class baritone.BaritoneProvider
-keep class baritone.api.IBaritoneProvider

View File

@ -63,6 +63,7 @@ public class CommandUnhandledException extends CommandErrorMessageException {
// line = line.replaceFirst("\\(([^)]+)\\)$", "\n\t . $1");
line = line.replaceFirst("\\([^:]+:(\\d+)\\)$", ":$1");
line = line.replaceFirst("\\(Unknown Source\\)$", "");
lines.set(i, line);
}
}

View File

@ -214,9 +214,9 @@ public class ArgConsumer {
public <T extends IDatatype> T getDatatype(Class<T> datatype) {
try {
return datatype.getConstructor(ArgConsumer.class).newInstance(this);
} catch (RuntimeException e) {
} catch (InvocationTargetException e) {
throw new CommandInvalidTypeException(has() ? peek() : consumed(), datatype.getSimpleName());
} catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) {
} catch (NoSuchMethodException | IllegalAccessException | InstantiationException e) {
throw new CommandUnhandledException(e);
}
}