use of com.leomelonseeds.missilewars.listener.JoinLeaveListener 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 :)");
}
Aggregations