Search in sources :

Example 1 with CheckCommand

use of com.nextplugins.economy.command.bukkit.CheckCommand 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.");
    }
}
Also used : BukkitFrame(me.saiintbrisson.bukkit.command.BukkitFrame) CheckCommand(com.nextplugins.economy.command.bukkit.CheckCommand) MessageHolder(me.saiintbrisson.minecraft.command.message.MessageHolder) MoneyCommand(com.nextplugins.economy.command.bukkit.MoneyCommand) NextEconomyCommand(com.nextplugins.economy.command.bukkit.NextEconomyCommand) PurseCommand(com.nextplugins.economy.command.bukkit.PurseCommand) FeatureValue(com.nextplugins.economy.configuration.FeatureValue) PurseValue(com.nextplugins.economy.configuration.PurseValue)

Aggregations

CheckCommand (com.nextplugins.economy.command.bukkit.CheckCommand)1 MoneyCommand (com.nextplugins.economy.command.bukkit.MoneyCommand)1 NextEconomyCommand (com.nextplugins.economy.command.bukkit.NextEconomyCommand)1 PurseCommand (com.nextplugins.economy.command.bukkit.PurseCommand)1 FeatureValue (com.nextplugins.economy.configuration.FeatureValue)1 PurseValue (com.nextplugins.economy.configuration.PurseValue)1 BukkitFrame (me.saiintbrisson.bukkit.command.BukkitFrame)1 MessageHolder (me.saiintbrisson.minecraft.command.message.MessageHolder)1