Better error handling for BrigadierCommand in bungee lib
This commit is contained in:
parent
0d7033d8c9
commit
29d036a13f
@ -42,8 +42,16 @@ public abstract class BrigadierCommand extends ChatStatic {
|
|||||||
}
|
}
|
||||||
dispatcher = BrigadierDispatcher.getInstance();
|
dispatcher = BrigadierDispatcher.getInstance();
|
||||||
|
|
||||||
LiteralArgumentBuilder<CommandSender> builder = buildCommand();
|
LiteralArgumentBuilder<CommandSender> builder;
|
||||||
String[] aliases = getAliases();
|
String[] aliases;
|
||||||
|
|
||||||
|
try {
|
||||||
|
builder = buildCommand();
|
||||||
|
aliases = getAliases();
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.severe("Exception encountered when building Brigadier command " + getClass().getName(), e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (aliases == null)
|
if (aliases == null)
|
||||||
aliases = new String[0];
|
aliases = new String[0];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user