use of com.nextplugins.economy.model.account.storage.AccountStorage in project NextEconomy by NextPlugins.
the class NextEconomy method onEnable.
@Override
public void onEnable() {
getLogger().info("Iniciando carregamento do plugin.");
val loadTime = Stopwatch.createStarted();
if (updateChecker.canUpdate()) {
val lastRelease = updateChecker.getLastRelease();
getLogger().info("");
getLogger().info("[NextUpdate] ATENÇÃO!");
getLogger().info("[NextUpdate] Você está usando uma versão antiga do NextEconomy!");
getLogger().info("[NextUpdate] Nova versão: " + lastRelease.getVersion());
getLogger().info("[NextUpdate] Baixe aqui: " + lastRelease.getDownloadURL());
getLogger().info("");
} else {
getLogger().info("[NextUpdate] Olá! Vim aqui revisar se a versão do NextEconomy está atualizada, e pelo visto sim! Obrigado por usar nossos plugins!");
}
sqlConnector = SQLProvider.of(this).setup(null);
sqlExecutor = new SQLExecutor(sqlConnector);
accountRepository = new AccountRepository(sqlExecutor);
accountStorage = new AccountStorage(accountRepository);
conversorManager = new ConversorManager(accountRepository);
rankingStorage = new RankingStorage();
backupManager = new BackupManager();
locationManager = new LocationManager();
groupWrapperManager = new GroupWrapperManager();
interactionRegistry = new InteractionRegistry();
discordCommandRegistry = new DiscordCommandRegistry();
rankingChatBody = new RankingChatBody();
internalTitleAPI = InternalAPIMapping.create();
val nickValue = getConfig().getString("plugin.configuration.save-method", "NICK");
val nickMode = nickValue.equalsIgnoreCase("NICK");
accountStorage.init(nickMode);
interactionRegistry.init();
InventoryManager.enable(this);
ConfigurationRegistry.of(this).register();
CommandRegistry.of(this).register();
VaultHookRegistry.of(this).register();
MetricProvider.of(this).register();
InventoryRegistry.of(this).register();
ConversorRegistry.of(this).register();
Bukkit.getScheduler().runTaskLater(this, () -> {
PlaceholderRegistry.of(this).register();
CustomRankingRegistry.of(this).register();
ListenerRegistry.of(this).register();
if (!PurseAPI.init())
getLogger().info("Sistema de bolsa de valores desativado.");
else
// force purse update
PurseAPI.getInstance();
groupWrapperManager.init();
// bump money top one time and add, if enabled, stands/npcs
rankingStorage.updateRanking(true);
registerPayDiscordManager();
discordCommandRegistry.init();
purgeBackups();
}, 150L);
loadTime.stop();
getLogger().log(Level.INFO, "Plugin inicializado com sucesso. ({0})", loadTime);
}
Aggregations