use of xyz.derkades.ublisk.utils.version_helper.V1_12_R1 in project Ublisk by Derkades.
the class Main method onEnable.
@Override
public void onEnable() {
instance = this;
Ublisk.RESTART_ERROR = false;
PacketListener.RUNNING = true;
Listeners.register();
Command.registerAll();
Mobs.clearMobs();
MobSpawn.startMobSpawning();
for (Task task : Task.values()) task.start();
Logger.startSiteLogger();
TodoList.initialize(DataFile.MYSQL.getConfig().getString("todo.ip"), DataFile.MYSQL.getConfig().getInt("todo.port"), DataFile.MYSQL.getConfig().getString("todo.database"), DataFile.MYSQL.getConfig().getString("todo.user"), DataFile.MYSQL.getConfig().getString("todo.password"));
for (UModule module : UModule.ALL_MODULES) {
try {
module.initialize();
} catch (Exception e) {
Logger.log(LogLevel.SEVERE, "Modules", "An error occured while initializing " + module.getClass().getSimpleName() + ": " + e.getMessage());
e.printStackTrace();
}
}
Bukkit.clearRecipes();
Ublisk.NMS = new V1_12_R1();
new SidebarAPI().onEnable();
new URunnable() {
public void run() {
Logger.log(LogLevel.INFO, "Cache", "Building up cache, expect some lag..");
for (Guild guild : Guild.getGuildsList()) {
guild.getDescription();
guild.getMembers();
guild.getOwner();
guild.getPoints();
}
for (UPlayer player : Ublisk.getOnlinePlayers()) {
player.getXP();
}
Logger.log(LogLevel.INFO, "Cache", "Complete! Now containing " + Cache.size() + " objects.");
Logger.log(LogLevel.INFO, "Guilds", "Deleting empty guilds...");
for (Guild guild : Guild.getGuildsList()) {
if (guild.getMembers().size() == 0) {
Logger.log(LogLevel.WARNING, "Guilds", "Automatically deleted " + guild.getName() + ", because it does not have any members.");
guild.remove();
}
}
}
}.runLater(10 * 20);
for (UPlayer player : Ublisk.getOnlinePlayers()) {
PlayerInfo.resetHashMaps(player);
}
Ublisk.openDatabaseConnection();
}
Aggregations