use of com.skelril.nitro.module.NModuleTrigger in project Skree by Skelril.
the class DatabaseSystem method init.
@NModuleTrigger(trigger = "PRE_INITIALIZATION")
public void init() {
try {
Class.forName("org.mariadb.jdbc.Driver").newInstance();
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
e.printStackTrace();
}
try {
DatabaseConfig config = ConfigLoader.loadConfig("database.json", DatabaseConfig.class);
String database = config.getDatabase();
String username = config.getUsername();
String password = config.getPassword();
setupHandle(database, username, password);
runMigrations(database, username, password);
} catch (IOException e) {
e.printStackTrace();
}
service = new DatabaseServiceImpl();
Sponge.getEventManager().registerListeners(SkreePlugin.inst(), service);
Sponge.getServiceManager().setProvider(SkreePlugin.inst(), DatabaseService.class, service);
}
use of com.skelril.nitro.module.NModuleTrigger in project Skree by Skelril.
the class DropClearSystem method init.
@NModuleTrigger(trigger = "SERVER_STARTED")
public void init() {
service = new DropClearServiceImpl(1000, 3);
// Register the service & command
Sponge.getServiceManager().setProvider(SkreePlugin.inst(), DropClearService.class, service);
Sponge.getEventManager().registerListeners(SkreePlugin.inst(), service);
Sponge.getCommandManager().register(SkreePlugin.inst(), DropClearCommand.aquireSpec(120), "dropclear", "dc");
}
use of com.skelril.nitro.module.NModuleTrigger in project Skree by Skelril.
the class RespawnSystem method init.
@NModuleTrigger(trigger = "SERVER_STARTED")
public void init() {
service = new RespawnServiceImpl();
// Register the service
Sponge.getEventManager().registerListeners(SkreePlugin.inst(), service);
Sponge.getServiceManager().setProvider(SkreePlugin.inst(), RespawnService.class, service);
}
use of com.skelril.nitro.module.NModuleTrigger in project Skree by Skelril.
the class RespawnQueueSystem method init.
@NModuleTrigger(trigger = "SERVER_STARTED")
public void init() {
service = new RespawnQueueServiceImpl();
// Register the service
Sponge.getEventManager().registerListeners(SkreePlugin.inst(), service);
Sponge.getServiceManager().setProvider(SkreePlugin.inst(), RespawnQueueService.class, service);
}
use of com.skelril.nitro.module.NModuleTrigger in project Skree by Skelril.
the class PvPSystem method init.
@NModuleTrigger(trigger = "SERVER_STARTED")
public void init() {
service = new PvPServiceImpl();
// Register the service & command
Sponge.getEventManager().registerListeners(SkreePlugin.inst(), service);
Sponge.getServiceManager().setProvider(SkreePlugin.inst(), PvPService.class, service);
Sponge.getCommandManager().register(SkreePlugin.inst(), PvPCommand.aquireSpec(), "pvp");
}
Aggregations