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