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");
}
Aggregations