use of com.nextplugins.economy.command.bukkit.MoneyCommand in project NextEconomy by NextPlugins.
the class CommandRegistry method register.
public void register() {
try {
BukkitFrame bukkitFrame = new BukkitFrame(plugin);
bukkitFrame.registerCommands(new MoneyCommand(plugin, plugin.getAccountStorage(), plugin.getLocationManager()), new NextEconomyCommand(plugin.getBackupManager(), plugin.getRankingStorage(), plugin.getAccountStorage(), plugin.getConversorManager()));
if (FeatureValue.get(FeatureValue::checkSystemEnabled)) {
bukkitFrame.registerCommands(new CheckCommand(plugin.getAccountStorage()));
}
if (PurseValue.get(PurseValue::enable)) {
bukkitFrame.registerCommands(new PurseCommand());
}
MessageHolder messageHolder = bukkitFrame.getMessageHolder();
messageHolder.setMessage(MessageType.ERROR, MessageValue.get(MessageValue::error));
messageHolder.setMessage(MessageType.INCORRECT_TARGET, MessageValue.get(MessageValue::incorrectTarget));
messageHolder.setMessage(MessageType.INCORRECT_USAGE, MessageValue.get(MessageValue::incorrectUsage));
messageHolder.setMessage(MessageType.NO_PERMISSION, MessageValue.get(MessageValue::noPermission));
plugin.getLogger().info("Comandos registrados com sucesso.");
} catch (Throwable t) {
t.printStackTrace();
plugin.getLogger().severe("Não foi possível registrar os comandos.");
}
}
Aggregations