Aliases were always conflicting

keep-around/d31701866686f66088b78de2e29736ae36e55a68
Pingex aka Raphaël 9 years ago
parent 5b0aede82d
commit f5fbd49b12

@ -36,13 +36,6 @@ public class CommandRegistry
LOGGER.info("Registering command {}.", toRegister.getName());
commandSet.add(toRegister);
// Check for conflicting aliases
toRegister.getAliases().stream().filter(CommandRegistry::aliasExists).forEach(i ->
{
LOGGER.warn("Conflicting alias {} for command {}, removing. (original command: {})", i, toRegister.getName(), getAliasByName(i).get().getName());
toRegister.getAliases().remove(i);
});
}
/**
@ -76,6 +69,15 @@ public class CommandRegistry
LOGGER.info("Removed command {}.", toUnregister.getName());
}
/**
* Get the current state of the registry.
* @return RO set of the bank.
*/
public static Set<Command> getRegistry()
{
return Collections.unmodifiableSet(commandSet);
}
/**
* Tells if the command is registered (excluding aliases).
* @param commandName Target command