package com.yuyu.srdisassemble;

import com.sakurarealm.sritem.bukkit.command.CommandBase;
import com.sakurarealm.sritem.bukkit.command.OpenCommand;
import com.yuyu.srdisassemble.command.DisCommand;
import com.yuyu.srdisassemble.config.ConfigManager;
import lombok.Getter;
import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;

public final class SrDisassemble extends JavaPlugin {

    @Getter
    private static SrDisassemble instance;//用于获取实例
    @Getter
    private static ConfigManager configManager;//用于鉴定


    @Override
    public void onEnable() {
        // Plugin startup logic
        getLogger().info(ChatColor.GOLD+"分解插件开始运行!");
        this.configManager = new ConfigManager(this);

        //注册指令
        CommandBase commandBase = new CommandBase();
        this.getCommand("srdisassemble").setExecutor(commandBase);
        commandBase.registerSubCommand("open",new DisCommand());
        commandBase.registerSubCommand("reload",new DisCommand());


    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}
