Search in sources :

Example 11 with NModuleTrigger

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

the class RegionSystem method init.

@NModuleTrigger(trigger = "SERVER_STARTED", dependencies = { "World System" })
public void init() {
    service = new RegionServiceImpl();
    Optional<WorldService> optWorldService = Sponge.getServiceManager().provide(WorldService.class);
    if (optWorldService.isPresent()) {
        for (World world : optWorldService.get().getEffectWrapper(BuildWorldWrapper.class).get().getWorlds()) {
            RegionManager manager = new RegionManager(world.getName());
            manager.load();
            service.addManager(world, manager);
        }
    }
    // Register the service & command
    Sponge.getEventManager().registerListeners(SkreePlugin.inst(), service);
    Sponge.getServiceManager().setProvider(SkreePlugin.inst(), RegionService.class, service);
    Sponge.getCommandManager().register(SkreePlugin.inst(), RegionCommand.aquireSpec(), "region", "rg");
}
Also used : RegionManager(com.skelril.skree.service.internal.region.RegionManager) RegionServiceImpl(com.skelril.skree.service.internal.region.RegionServiceImpl) World(org.spongepowered.api.world.World) WorldService(com.skelril.skree.service.WorldService) NModuleTrigger(com.skelril.nitro.module.NModuleTrigger)

Example 12 with NModuleTrigger

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

the class ModifierSystem method init.

@NModuleTrigger(trigger = "SERVER_STARTED")
public void init() {
    service = new LazyMySQLModifierService();
    // Register the service
    Sponge.getEventManager().registerListeners(SkreePlugin.inst(), new ModifierNotifier());
    Sponge.getServiceManager().setProvider(SkreePlugin.inst(), ModifierService.class, service);
    Sponge.getCommandManager().register(SkreePlugin.inst(), ModExtendCommand.aquireSpec(), "modextend");
}
Also used : ModifierNotifier(com.skelril.skree.content.modifier.ModifierNotifier) LazyMySQLModifierService(com.skelril.skree.service.internal.modifier.LazyMySQLModifierService) NModuleTrigger(com.skelril.nitro.module.NModuleTrigger)

Example 13 with NModuleTrigger

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

the class PlayerStateSystem method init.

@NModuleTrigger(trigger = "SERVER_STARTED")
public void init() {
    service = new PlayerStateServiceImpl();
    // Register the service & command
    Sponge.getServiceManager().setProvider(SkreePlugin.inst(), PlayerStateService.class, service);
    Sponge.getEventManager().registerListeners(SkreePlugin.inst(), service);
    Sponge.getCommandManager().removeMapping(Sponge.getCommandManager().get("gamemode").get());
    Sponge.getCommandManager().register(SkreePlugin.inst(), GameModeCommand.aquireSpec(), "gamemode", "gm");
}
Also used : PlayerStateServiceImpl(com.skelril.skree.service.internal.playerstate.PlayerStateServiceImpl) NModuleTrigger(com.skelril.nitro.module.NModuleTrigger)

Example 14 with NModuleTrigger

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

the class ArrowFishingSystem method init.

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

Example 15 with NModuleTrigger

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

the class ItemRestrictionSystem method init.

@NModuleTrigger(trigger = "SERVER_STARTED")
public void init() {
    try {
        ItemRestrictionConfig config = ConfigLoader.loadConfig("item_restriction.json", ItemRestrictionConfig.class);
        Set<String> blockedItems = config.getBlockedItems();
        Sponge.getEventManager().registerListeners(SkreePlugin.inst(), new ItemCraftBlockingListener(blockedItems));
        Sponge.getEventManager().registerListeners(SkreePlugin.inst(), new ItemInteractBlockingListener(blockedItems));
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Also used : ItemInteractBlockingListener(com.skelril.skree.content.itemrestriction.ItemInteractBlockingListener) IOException(java.io.IOException) ItemCraftBlockingListener(com.skelril.skree.content.itemrestriction.ItemCraftBlockingListener) 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