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();
}
}
Aggregations