Search in sources :

Example 1 with CommandHandler

use of net.warvale.core.commands.CommandHandler in project GameCore by Warvale.

the class Main method onEnable.

@Override
public void onEnable() {
    instance = this;
    setupClasses();
    ConfigManager.getInstance().setup();
    MessageManager.getInstance().setup();
    board = new BoardManager(this);
    board.setup();
    teams = new TeamManager(this, board);
    teams.setup();
    Game.getInstance().setup();
    new JoinServer(this);
    new LeaveServer(this);
    new GlobalEvent(this);
    new TeamSelect(this);
    new ClassSelect(this);
    new Preferences(this);
    Bukkit.getPluginManager().registerEvents(new PingListener(), this);
    for (BroadcastType type : BroadcastType.values()) {
        switch(type) {
            case TIP:
                BroadcastType.autoBroadcastTip(NumberUtils.random(100, 1), NumberUtils.random(7000, 6000));
                break;
            case ADVERTISEMENT:
                BroadcastType.autoBroadcastAdvertisement(NumberUtils.random(100, 1), NumberUtils.random(7000, 6000));
                break;
        }
    }
    //register commands
    commandHandler = new CommandHandler(this);
    commandHandler.registerCommands();
    /* Register AbilityManager */
    Bukkit.getServer().getPluginManager().registerEvents(new AbilityManager(), this);
    //register scoreboards
    ScoreboardTask.getInstance().runTaskTimer(this, 0, 20);
    LobbyTask.getInstance().runTaskTimer(this, 0, 20);
    //load the maps
    try {
        GameMap.getMaps().put("Redwood Forest", new GameMap("redwood_forest"));
        GameMap.getMaps().put("Volcano Island", new GameMap("volcano_island"));
        GameMap.getMaps().put("Pagoda Everglade", new GameMap("pagoda_everglade"));
        GameMap.getMaps().put("Extraterrestrial", new GameMap("extraterrestrial"));
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}
Also used : AbilityManager(net.warvale.core.classes.abilities.AbilityManager) TeamManager(net.warvale.core.game.logic.TeamManager) GameMap(net.warvale.core.map.GameMap) ClassSelect(net.warvale.core.spec.ClassSelect) LeaveServer(net.warvale.core.connect.LeaveServer) CommandHandler(net.warvale.core.commands.CommandHandler) SQLException(java.sql.SQLException) ParseException(java.text.ParseException) TeamSelect(net.warvale.core.spec.TeamSelect) BroadcastType(net.warvale.core.chat.BroadcastType) PingListener(net.warvale.core.connect.PingListener) JoinServer(net.warvale.core.connect.JoinServer) Preferences(net.warvale.core.spec.Preferences) BoardManager(net.warvale.core.game.logic.BoardManager)

Aggregations

SQLException (java.sql.SQLException)1 ParseException (java.text.ParseException)1 BroadcastType (net.warvale.core.chat.BroadcastType)1 AbilityManager (net.warvale.core.classes.abilities.AbilityManager)1 CommandHandler (net.warvale.core.commands.CommandHandler)1 JoinServer (net.warvale.core.connect.JoinServer)1 LeaveServer (net.warvale.core.connect.LeaveServer)1 PingListener (net.warvale.core.connect.PingListener)1 BoardManager (net.warvale.core.game.logic.BoardManager)1 TeamManager (net.warvale.core.game.logic.TeamManager)1 GameMap (net.warvale.core.map.GameMap)1 ClassSelect (net.warvale.core.spec.ClassSelect)1 Preferences (net.warvale.core.spec.Preferences)1 TeamSelect (net.warvale.core.spec.TeamSelect)1