use of me.gameisntover.kbffa.gui.ButtonManager in project KnockbackFFA by GaMeIsNtOvEr.
the class KnockbackFFA method onEnable.
@SneakyThrows
@Override
public void onEnable() {
long time = System.currentTimeMillis();
instance = this;
getLogger().info("Loading config files...");
if (!getDataFolder().exists())
getDataFolder().mkdir();
loadConfig();
loadMessages();
loadSounds();
getLogger().info("Connecting to the database...");
databaseManager = new DatabaseManager("SQLITE");
arenaManager = new ArenaManager();
kitManager = new KitManager();
blockDataManager = new BlockDataManager();
botManager = new BotManager();
scoreboardManager = new BoardManager();
buttonManager = new ButtonManager();
Field f = getServer().getClass().getDeclaredField("commandMap");
f.setAccessible(true);
commandMap = (CommandMap) f.get(getServer());
getLogger().info("Loading Commands");
commandManager = new CommandManager();
getLogger().info("Loading Listeners");
loadListeners();
getLogger().info("Loading Tasks");
loadTasks();
long takenTime = (System.currentTimeMillis() - time);
getLogger().info("Plugin loaded successfully in " + takenTime + "ms");
registerPlaceholders();
if (!Bukkit.getOnlinePlayers().isEmpty()) {
for (Player player : Bukkit.getOnlinePlayers()) {
Knocker knocker = getKnocker(player);
knocker.setInGame(BungeeMode());
}
}
for (Knocker p : getInGamePlayers()) {
if (p.getPlayer().getInventory().contains(Material.BOW) && !p.getPlayer().getInventory().contains(Material.ARROW))
p.getInventory().addItem(Items.ARROW.getItem());
}
}
Aggregations