use of org.cubeengine.butler.alias.AliasConfiguration in project core by CubeEngine.
the class CubeCommandManager method registerSpongeCommand.
private Optional<CommandMapping> registerSpongeCommand(CommandDescriptor descriptor) {
ArrayList<String> aliasList = new ArrayList<>();
aliasList.add(descriptor.getName().toLowerCase());
for (AliasConfiguration alias : descriptor.getAliases()) {
if ((alias.getDispatcher() == null || (alias.getDispatcher() != null && alias.getDispatcher().length == 0))) {
aliasList.add(alias.getName().toLowerCase());
}
}
PluginContainer plugin = mm.getPlugin(descriptor.getOwner()).orElse(mm.getPlugin(LibCube.class).get());
return baseDispatcher.register(plugin, new ProxyCallable(this, commandTime, descriptor.getName(), logger), aliasList);
}
Aggregations