当前位置: 首页>>代码示例>>Java>>正文


Java GamePostInitializationEvent类代码示例

本文整理汇总了Java中org.spongepowered.api.event.game.state.GamePostInitializationEvent的典型用法代码示例。如果您正苦于以下问题:Java GamePostInitializationEvent类的具体用法?Java GamePostInitializationEvent怎么用?Java GamePostInitializationEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GamePostInitializationEvent类属于org.spongepowered.api.event.game.state包,在下文中一共展示了GamePostInitializationEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onEnable

import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onEnable(GamePostInitializationEvent event) throws IOException
{
    this.logger = mm.getLoggerFor(Portals.class);
    this.path = mm.getPathFor(Portals.class);
    reflector.getDefaultConverterManager().registerConverter(new DestinationConverter(), Destination.class);
    Providers rManager = cm.getProviders();
    rManager.register(this, new PortalParser(this), Portal.class);
    rManager.register(this, new DestinationParser(this, i18n), Destination.class);

    this.portalsDir = Files.createDirectories(path.resolve("portals"));

    PortalCommands portals = new PortalCommands(cm, this, selector, reflector, i18n);
    cm.addCommand(portals);
    portals.addCommand(new PortalModifyCommand(cm, this, selector, i18n));

    em.registerListener(Portals.class, new PortalListener(this, i18n));
    this.loadPortals();
    tm.runTimer(Portals.class, this::checkForEntitiesInPortals, 5, 5);
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:21,代码来源:Portals.java

示例2: onEnable

import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onEnable(GamePostInitializationEvent event)
{
    reflector.getDefaultConverterManager().registerConverter(new InetAddressConverter(), InetAddress.class);

    this.configure(reflector.load(ApiConfig.class, moduleFolder.resolve("webapi.yml").toFile()));

    try
    {
        this.start();
        final ObjectMapper mapper = new ObjectMapper();
        LoggerUtil.attachCallback(null, (f, a, t, msg) -> {
            ObjectNode node = mapper.createObjectNode();
            node.put("msg", msg);
            this.fireEvent("console", node);
        });
    }
    catch (ApiStartupException ex)
    {
        this.logger.error(ex, "The web API will not be available as the server failed to start properly...");
    }

    this.registerApiHandlers(ApiServer.class, new CommandController(i18n, tm, cm));
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:25,代码来源:ApiServer.java

示例3: onPostInit

import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Override
public void onPostInit(GamePostInitializationEvent event) {
    CommandsConfig config = UltimateCore.get().getCommandsConfig();
    CommentedConfigurationNode node = config.get();
    boolean modified = false;
    for (Command cmd : UltimateCore.get().getCommandService().getCommands()) {
        CommentedConfigurationNode cmdnode = node.getNode("commands", cmd.getIdentifier());
        if (cmdnode.getNode("cooldown").getValue() == null) {
            modified = true;
            cmdnode.getNode("cooldown").setComment("Time in seconds that a player has to wait between uses of the command. (0 to disable)");
            cmdnode.getNode("cooldown").setValue("0s");
        }
        if (cmdnode.getNode("warmup").getValue() == null) {
            modified = true;
            cmdnode.getNode("warmup").setComment("Time in seconds that a player has to wait before the command is executed. (0 to disable)");
            cmdnode.getNode("warmup").setValue("0s");
        }
    }
    if (modified) {
        config.save(node);
    }
    onReload(null);
    new CommandtimerPermissions();
}
 
开发者ID:Bammerbom,项目名称:UltimateCore,代码行数:25,代码来源:CommandtimerModule.java

示例4: onPostInitialization

import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onPostInitialization(GamePostInitializationEvent event)
{
    this.translation = new VirtualChestTranslation(this);
    this.virtualChestActions = new VirtualChestActions(this);
    this.commandAliases = new VirtualChestCommandAliases(this);
    this.economyManager = new VirtualChestEconomyManager(this);
    this.dispatcher = new VirtualChestInventoryDispatcher(this);
    this.scriptManager = new VirtualChestJavaScriptManager(this);
    this.permissionManager = new VirtualChestPermissionManager(this);
    this.placeholderManager = new VirtualChestPlaceholderManager(this);
    this.virtualChestCommandManager = new VirtualChestCommandManager(this);
    this.actionIntervalManager = new VirtualChestActionIntervalManager(this);
}
 
开发者ID:ustc-zzzz,项目名称:VirtualChest,代码行数:15,代码来源:VirtualChestPlugin.java

示例5: onPostInit

import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener(order = Order.POST)
public void onPostInit(GamePostInitializationEvent event) {
    Optional<ProviderRegistration<PaginationService>> optService = Sponge.getGame().getServiceManager().getRegistration(PaginationService.class);
    if (optService.isPresent()) {
        PaginationService service = optService.get().getProvider();
        Sponge.getGame().getServiceManager().setProvider(this, PaginationService.class, new TabbedPaginationService(service));
    }
    this.features.load();
}
 
开发者ID:simon816,项目名称:ChatUI,代码行数:10,代码来源:ChatUI.java

示例6: onGamePostInitializationAfterPre

import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener(order = Order.AFTER_PRE)
public void onGamePostInitializationAfterPre(GamePostInitializationEvent event) {
    logger.info("Loading CustomItemLibrary...");
    setupManagers();
    setupService();
    setupCommands();
    logger.info("CustomItemLibrary loaded.");
}
 
开发者ID:Limeth,项目名称:CustomItemLibrary,代码行数:9,代码来源:CustomItemLibrary.java

示例7: onPostInitialization

import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onPostInitialization(GamePostInitializationEvent event) {
    if (foundProvider) {
        // Register events and commands
        registerEvents();
        registerCommands();
    }
}
 
开发者ID:Flibio,项目名称:JobsLite,代码行数:9,代码来源:JobsLite.java

示例8: onEnable

import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onEnable(GamePostInitializationEvent event)
{
    this.logger = mm.getLoggerFor(Protector.class);
    this.modulePath = mm.getPathFor(Protector.class);
    manager = new RegionManager(modulePath, reflector, logger);
    ps.registerContextCalculator(new RegionContextCalculator(manager));
    RegionCommands regionCmd = new RegionCommands(cm, selector, manager, i18n);
    i18n.getCompositor().registerFormatter(new RegionFormatter());
    cm.addCommand(regionCmd);
    SettingsCommands settingsCmd = new SettingsCommands(manager, i18n, ps, pm, em, cm);
    regionCmd.addCommand(settingsCmd);
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:14,代码来源:Protector.java

示例9: onEnable

import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onEnable(GamePostInitializationEvent event)
{
    this.logger = mm.getLoggerFor(Signmarket.class);
    manager = new MarketSignManager(i18n, es, this, igf, plugin);
    editModeListener = new EditModeCommand(cm, em, this, i18n, manager);
    em.registerListener(Signmarket.class, new MarketSignListener(manager, this, i18n));
    smCmds = new SignMarketCommands(cm, this, i18n);
    cm.addCommand(smCmds);
    perms = new MarketSignPerm(pm, smCmds);
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:12,代码来源:Signmarket.java

示例10: onEnable

import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onEnable(GamePostInitializationEvent event)
{
    Optional<EconomyService> economy = Sponge.getServiceManager().provide(EconomyService.class);
    if (!economy.isPresent())
    {
        this.logger.error("Missing required EconomyService. Do you have a plugin installed that provides it?");
        this.logger.info("Listeners and Commands will not be registered.");
        return;
    }
    this.repairBlockManager = new RepairBlockManager(this, db, em, i18n, economy.get(), pm);
    em.registerListener(Itemrepair.class, new ItemRepairListener(this, i18n));
    cm.addCommand(new ItemRepairCommands(cm, this, em, i18n));
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:15,代码来源:Itemrepair.java

示例11: onEnable

import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onEnable(GamePostInitializationEvent event)
{
    em.registerListener(Spawn.class, new SpawnListener(pm));
    cm.removeCommand("spawn", true); // unregister basics commands
    cm.addCommands(cm, this, new SpawnCommands(this, i18n, pm));
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:8,代码来源:Spawn.java

示例12: onPostInitialization

import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onPostInitialization(GamePostInitializationEvent event) {
	instance = this;
	enabled = validateSpongeVersion();
}
 
开发者ID:DevOnTheRocks,项目名称:StickyChunk,代码行数:6,代码来源:StickyChunk.java

示例13: onGamePostInit

import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onGamePostInit(GamePostInitializationEvent event) {
}
 
开发者ID:LanternPowered,项目名称:Porygen,代码行数:4,代码来源:PorygenPlugin.java

示例14: onPostInitialize

import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onPostInitialize(GamePostInitializationEvent event) {
    ClansImpl.getInstance().getClanPermissionManager().setInitialized();
}
 
开发者ID:iLefty,项目名称:mcClans,代码行数:5,代码来源:MCClans.java

示例15: onPostInit

import org.spongepowered.api.event.game.state.GamePostInitializationEvent; //导入依赖的package包/类
@Listener
public void onPostInit(GamePostInitializationEvent e) {
	if (db == null) return;
	logger.info("Registering plugin commands");
	registerCommands(Sponge.getCommandManager());
}
 
开发者ID:Karanum,项目名称:AdamantineShield,代码行数:7,代码来源:AdamantineShield.java


注:本文中的org.spongepowered.api.event.game.state.GamePostInitializationEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。