use of com.erigitic.jobs.TEJobManager in project TotalEconomy by Erigitic.
the class TotalEconomy method preInit.
@Listener
public void preInit(GamePreInitializationEvent event) {
setupConfig();
defaultCurrency = new TECurrency(Text.of(config.getNode("currency", "currency-singular").getValue()), Text.of(config.getNode("currency", "currency-plural").getValue()), Text.of(config.getNode("currency", "symbol").getValue()), 2, true, config.getNode("currency", "prefix-symbol").getBoolean());
loadJobs = config.getNode("features", "jobs", "enable").getBoolean();
loadSalary = config.getNode("features", "jobs", "salary").getBoolean();
databaseActive = config.getNode("database", "enable").getBoolean();
jobPermissions = config.getNode("features", "jobs", "permissions").getBoolean();
jobNotifications = config.getNode("features", "jobs", "notifications").getBoolean();
loadMoneyCap = config.getNode("features", "moneycap", "enable").getBoolean();
if (databaseActive) {
databaseUrl = config.getNode("database", "url").getString();
databaseUser = config.getNode("database", "user").getString();
databasePassword = config.getNode("database", "password").getString();
sqlHandler = new SQLHandler(this);
}
saveInterval = config.getNode("save-interval").getInt(30);
accountManager = new AccountManager(this);
game.getServiceManager().setProvider(this, EconomyService.class, accountManager);
//Only setup job stuff if config is set to load jobs
if (loadJobs) {
teJobManager = new TEJobManager(this);
}
if (loadMoneyCap == true) {
moneyCap = BigDecimal.valueOf(config.getNode("features", "moneycap", "amount").getFloat()).setScale(2, BigDecimal.ROUND_DOWN);
}
}
Aggregations