Search in sources :

Example 1 with RegionManager

use of com.skelril.skree.service.internal.region.RegionManager 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)

Aggregations

NModuleTrigger (com.skelril.nitro.module.NModuleTrigger)1 WorldService (com.skelril.skree.service.WorldService)1 RegionManager (com.skelril.skree.service.internal.region.RegionManager)1 RegionServiceImpl (com.skelril.skree.service.internal.region.RegionServiceImpl)1 World (org.spongepowered.api.world.World)1