Search in sources :

Example 16 with NModuleTrigger

use of com.skelril.nitro.module.NModuleTrigger in project Skree by Skelril.

the class AidSystem method init.

@NModuleTrigger(trigger = "SERVER_STARTED")
public void init() {
    try {
        AntiPeskConfig config = ConfigLoader.loadConfig("anti_pesk.json", AntiPeskConfig.class);
        Sponge.getEventManager().registerListeners(SkreePlugin.inst(), new ChatCommandAid());
        Sponge.getEventManager().registerListeners(SkreePlugin.inst(), new AntiPeskListener(config));
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Also used : AntiPeskListener(com.skelril.skree.content.aid.AntiPeskListener) IOException(java.io.IOException) ChatCommandAid(com.skelril.skree.content.aid.ChatCommandAid) NModuleTrigger(com.skelril.nitro.module.NModuleTrigger)

Example 17 with NModuleTrigger

use of com.skelril.nitro.module.NModuleTrigger in project Skree by Skelril.

the class AntiHackSystem method init.

@NModuleTrigger(trigger = "SERVER_STARTED")
public void init() {
    Sponge.getEventManager().registerListeners(SkreePlugin.inst(), new AntiJumpListener());
    Sponge.getEventManager().registerListeners(SkreePlugin.inst(), new AntiRailDupeListener());
}
Also used : AntiRailDupeListener(com.skelril.skree.content.anticheat.AntiRailDupeListener) AntiJumpListener(com.skelril.skree.content.anticheat.AntiJumpListener) NModuleTrigger(com.skelril.nitro.module.NModuleTrigger)

Example 18 with NModuleTrigger

use of com.skelril.nitro.module.NModuleTrigger in project Skree by Skelril.

the class ShutdownSystem method init.

@NModuleTrigger(trigger = "SERVER_STARTED")
public void init() {
    service = new ShutdownServiceImpl();
    // Register the service & command
    Sponge.getServiceManager().setProvider(SkreePlugin.inst(), ShutdownService.class, service);
    Sponge.getCommandManager().register(SkreePlugin.inst(), ShutdownCommand.aquireSpec(), "shutdown");
}
Also used : ShutdownServiceImpl(com.skelril.skree.service.internal.shutdown.ShutdownServiceImpl) NModuleTrigger(com.skelril.nitro.module.NModuleTrigger)

Example 19 with NModuleTrigger

use of com.skelril.nitro.module.NModuleTrigger in project Skree by Skelril.

the class ZoneSystem method init.

@NModuleTrigger(trigger = "SERVER_STARTED", dependencies = { "World System" })
public void init() {
    Optional<WorldService> optService = Sponge.getServiceManager().provide(WorldService.class);
    World world = optService.get().getEffectWrapper(InstanceWorldWrapper.class).get().getWorlds().iterator().next();
    Task.builder().execute(() -> {
        WorldResolver instWorldResolver = new WorldResolver(world, WorldEdit.getInstance());
        service = new ZoneServiceImpl(new CacheBasedAllocator(Decorators.ZONE_PRIMARY_DECORATOR, instWorldResolver));
        service.registerManager(new CursedMineManager());
        service.registerManager(new TempleOfFateManager());
        try {
            service.registerManager(new TheForgeManager(loadConfig("zone/the_forge.json", TheForgeConfig.class)));
        } catch (IOException e) {
            e.printStackTrace();
        }
        service.registerManager(new CatacombsManager());
        service.registerManager(new DesmireDungeonManager());
        service.registerManager(new FreakyFourManager());
        service.registerManager(new GoldRushManager());
        service.registerManager(new JungleRaidManager());
        service.registerManager(new PatientXManager());
        service.registerManager(new ShnugglesPrimeManager());
        service.registerManager(new SkyWarsManager());
        service.registerManager(new TheButcherShopManager());
        Sponge.getServiceManager().setProvider(SkreePlugin.inst(), ZoneService.class, service);
        Sponge.getCommandManager().register(SkreePlugin.inst(), ZoneMeCommand.aquireSpec(), "zoneme");
    }).delayTicks(1).submit(SkreePlugin.inst());
}
Also used : CacheBasedAllocator(com.skelril.skree.service.internal.zone.allocator.CacheBasedAllocator) JungleRaidManager(com.skelril.skree.content.zone.group.jungleraid.JungleRaidManager) WorldResolver(com.skelril.skree.service.internal.zone.WorldResolver) TempleOfFateManager(com.skelril.skree.content.zone.global.templeoffate.TempleOfFateManager) ShnugglesPrimeManager(com.skelril.skree.content.zone.group.shnugglesprime.ShnugglesPrimeManager) TheForgeManager(com.skelril.skree.content.zone.global.theforge.TheForgeManager) IOException(java.io.IOException) World(org.spongepowered.api.world.World) ZoneServiceImpl(com.skelril.skree.service.internal.zone.ZoneServiceImpl) WorldService(com.skelril.skree.service.WorldService) GoldRushManager(com.skelril.skree.content.zone.group.goldrush.GoldRushManager) PatientXManager(com.skelril.skree.content.zone.group.patientx.PatientXManager) SkyWarsManager(com.skelril.skree.content.zone.group.skywars.SkyWarsManager) CatacombsManager(com.skelril.skree.content.zone.group.catacombs.CatacombsManager) DesmireDungeonManager(com.skelril.skree.content.zone.group.desmiredungeon.DesmireDungeonManager) FreakyFourManager(com.skelril.skree.content.zone.group.freakyfour.FreakyFourManager) TheButcherShopManager(com.skelril.skree.content.zone.group.thebutchershop.TheButcherShopManager) CursedMineManager(com.skelril.skree.content.zone.global.cursedmine.CursedMineManager) NModuleTrigger(com.skelril.nitro.module.NModuleTrigger)

Example 20 with NModuleTrigger

use of com.skelril.nitro.module.NModuleTrigger in project Skree by Skelril.

the class HighScoreSystem method init.

@NModuleTrigger(trigger = "PRE_INITIALIZATION")
public void init() {
    service = new HighScoreServiceImpl();
    Sponge.getServiceManager().setProvider(SkreePlugin.inst(), HighScoreService.class, service);
    Sponge.getCommandManager().register(SkreePlugin.inst(), HighScoreCommand.aquireSpec(), "highscores", "highscore");
}
Also used : HighScoreServiceImpl(com.skelril.skree.service.internal.highscore.HighScoreServiceImpl) 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