package org.black_ixx.bossshop.managers;

import org.black_ixx.bossshop.BossShop;
import org.black_ixx.timedCommands.TimedCommands;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;

public class TimeHandler{

    private BossShop mPlugin;
    private TimedCommands tc;

    public TimeHandler(BossShop pPlugin){
        this.mPlugin=pPlugin;
    }

    private void buildPlugin(){
        Plugin plugin=Bukkit.getServer().getPluginManager().getPlugin("TimedCommands");
        if(plugin!=null){
            tc=(TimedCommands.class.cast(plugin));
        }else{
            this.mPlugin.warn("未发现TimedCommands插件,如果你需要使用该插件,请前往: http://dev.bukkit.org/bukkit-plugins/scheduledcommands/");
            return;
        }
    }
    
    public TimedCommands getTimedCommands(){
        if(tc==null) this.buildPlugin();
        return tc;
    }

}
