Search in sources :

Example 1 with SpectateCommand

use of com.leomelonseeds.missilewars.commands.SpectateCommand in project MissileWars by Leomelonseeds.

the class MissileWarsPlugin method onEnable.

@Override
public void onEnable() {
    // Load instance
    plugin = this;
    // Register serializable data
    ConfigurationSerialization.registerClass(Arena.class);
    // Save data files
    log("Loading and saving config files...");
    saveDefaultConfig();
    saveIfNotPresent("messages.yml");
    saveIfNotPresent("sounds.yml");
    saveIfNotPresent("items.yml");
    saveIfNotPresent("maps.yml");
    saveIfNotPresent("ranks.yml");
    saveIfNotPresent("default.json");
    log("Loaded all config files.");
    // Load commands and events
    log("Loading commands and events...");
    getCommand("MissileWars").setExecutor(new MissileWarsCommand());
    getCommand("Spectate").setExecutor(new SpectateCommand());
    getCommand("VoteMap").setExecutor(new VoteMapCommand());
    Bukkit.getPluginManager().registerEvents(new ArenaGameruleListener(), this);
    Bukkit.getPluginManager().registerEvents(new ArenaInventoryListener(), this);
    Bukkit.getPluginManager().registerEvents(new JoinLeaveListener(), this);
    Bukkit.getPluginManager().registerEvents(new CustomItemListener(), this);
    Bukkit.getPluginManager().registerEvents(new WorldCreationListener(), this);
    log("Commands and events loaded.");
    // Load decks
    log("Creating and loading deck items...");
    deckManager = new DeckManager();
    log("All deck items locked and loaded.");
    // Load player deck cache
    log("Starting player deck cache...");
    jsonManager = new JSONManager(this);
    log("Player deck cache loaded!");
    // Load arenas
    log("Loading up arenas...");
    arenaManager = new ArenaManager(this);
    arenaManager.loadArenas();
    log("All arenas ready to go.");
    // Load placeholders
    log("Hooking into PlaceholderAPI...");
    new MissileWarsPlaceholder().register();
    log("All placeholders registered.");
    // Load economy
    log("Hooking into Vault...");
    setupVault();
    log("Economy setup complete.");
    // Load MySQL
    log("Setting up the MySQL database...");
    setupDatabase();
    log("MySQL setup complete.");
    log("Missile Wars is ready to play :)");
}
Also used : ArenaGameruleListener(com.leomelonseeds.missilewars.listener.ArenaGameruleListener) ArenaManager(com.leomelonseeds.missilewars.arenas.ArenaManager) JSONManager(com.leomelonseeds.missilewars.utilities.JSONManager) MissileWarsPlaceholder(com.leomelonseeds.missilewars.utilities.MissileWarsPlaceholder) JoinLeaveListener(com.leomelonseeds.missilewars.listener.JoinLeaveListener) VoteMapCommand(com.leomelonseeds.missilewars.commands.VoteMapCommand) ArenaInventoryListener(com.leomelonseeds.missilewars.listener.ArenaInventoryListener) DeckManager(com.leomelonseeds.missilewars.decks.DeckManager) CustomItemListener(com.leomelonseeds.missilewars.listener.CustomItemListener) WorldCreationListener(com.leomelonseeds.missilewars.listener.WorldCreationListener) MissileWarsCommand(com.leomelonseeds.missilewars.commands.MissileWarsCommand) SpectateCommand(com.leomelonseeds.missilewars.commands.SpectateCommand)

Aggregations

ArenaManager (com.leomelonseeds.missilewars.arenas.ArenaManager)1 MissileWarsCommand (com.leomelonseeds.missilewars.commands.MissileWarsCommand)1 SpectateCommand (com.leomelonseeds.missilewars.commands.SpectateCommand)1 VoteMapCommand (com.leomelonseeds.missilewars.commands.VoteMapCommand)1 DeckManager (com.leomelonseeds.missilewars.decks.DeckManager)1 ArenaGameruleListener (com.leomelonseeds.missilewars.listener.ArenaGameruleListener)1 ArenaInventoryListener (com.leomelonseeds.missilewars.listener.ArenaInventoryListener)1 CustomItemListener (com.leomelonseeds.missilewars.listener.CustomItemListener)1 JoinLeaveListener (com.leomelonseeds.missilewars.listener.JoinLeaveListener)1 WorldCreationListener (com.leomelonseeds.missilewars.listener.WorldCreationListener)1 JSONManager (com.leomelonseeds.missilewars.utilities.JSONManager)1 MissileWarsPlaceholder (com.leomelonseeds.missilewars.utilities.MissileWarsPlaceholder)1