// TODO: Fall-back for Vanilla / CB commands? [Fall-back should be altering permission defaults, though negating permissions is the right way.]
// Fall-back: plugin commands.
for (final Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
if (plugin instanceof JavaPlugin) {
final JavaPlugin javaPlugin = (JavaPlugin) plugin;
final Map<String, Map<String, Object>> map = javaPlugin.getDescription().getCommands();
if (map != null) {
for (String label : map.keySet()) {
Command command = javaPlugin.getCommand(label);
if (command != null) {
commands.add(command);
}
}
}