Search in sources :

Example 1 with NModuleTrigger

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);
}
Also used : IOException(java.io.IOException) DatabaseServiceImpl(com.skelril.skree.service.internal.database.DatabaseServiceImpl) NModuleTrigger(com.skelril.nitro.module.NModuleTrigger)

Example 2 with NModuleTrigger

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");
}
Also used : DropClearServiceImpl(com.skelril.skree.service.internal.dropclear.DropClearServiceImpl) NModuleTrigger(com.skelril.nitro.module.NModuleTrigger)

Example 3 with NModuleTrigger

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);
}
Also used : RespawnServiceImpl(com.skelril.skree.service.internal.respawn.RespawnServiceImpl) NModuleTrigger(com.skelril.nitro.module.NModuleTrigger)

Example 4 with NModuleTrigger

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);
}
Also used : RespawnQueueServiceImpl(com.skelril.skree.service.internal.respawnqueue.RespawnQueueServiceImpl) NModuleTrigger(com.skelril.nitro.module.NModuleTrigger)

Example 5 with NModuleTrigger

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");
}
Also used : PvPServiceImpl(com.skelril.skree.service.internal.pvp.PvPServiceImpl) NModuleTrigger(com.skelril.nitro.module.NModuleTrigger)

Aggregations

NModuleTrigger (com.skelril.nitro.module.NModuleTrigger)20 IOException (java.io.IOException)6 WorldService (com.skelril.skree.service.WorldService)2 World (org.spongepowered.api.world.World)2 AntiPeskListener (com.skelril.skree.content.aid.AntiPeskListener)1 ChatCommandAid (com.skelril.skree.content.aid.ChatCommandAid)1 AntiJumpListener (com.skelril.skree.content.anticheat.AntiJumpListener)1 AntiRailDupeListener (com.skelril.skree.content.anticheat.AntiRailDupeListener)1 ArrowFishingHandler (com.skelril.skree.content.arrowfishing.ArrowFishingHandler)1 ItemCraftBlockingListener (com.skelril.skree.content.itemrestriction.ItemCraftBlockingListener)1 ItemInteractBlockingListener (com.skelril.skree.content.itemrestriction.ItemInteractBlockingListener)1 ModifierNotifier (com.skelril.skree.content.modifier.ModifierNotifier)1 BarrierWorldGeneratorModifier (com.skelril.skree.content.world.BarrierWorldGeneratorModifier)1 NoOreWorldGeneratorModifier (com.skelril.skree.content.world.NoOreWorldGeneratorModifier)1 SolidWorldGeneratorModifier (com.skelril.skree.content.world.SolidWorldGeneratorModifier)1 VoidWorldGeneratorModifier (com.skelril.skree.content.world.VoidWorldGeneratorModifier)1 WildernessWorldGeneratorModifier (com.skelril.skree.content.world.wilderness.WildernessWorldGeneratorModifier)1 CursedMineManager (com.skelril.skree.content.zone.global.cursedmine.CursedMineManager)1 TempleOfFateManager (com.skelril.skree.content.zone.global.templeoffate.TempleOfFateManager)1 TheForgeManager (com.skelril.skree.content.zone.global.theforge.TheForgeManager)1