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


Java GameStoppingEvent类代码示例

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


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

示例1: reload

import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void reload(GameReloadEvent event) throws Exception {
	Cause cause = Cause.source(this).build();

	// Unregistering everything
	GameStoppingEvent gameStoppingEvent = SpongeEventFactory.createGameStoppingEvent(cause);
	stop(gameStoppingEvent);

	// Starting over
	GameInitializationEvent gameInitializationEvent = SpongeEventFactory.createGameInitializationEvent(cause);
	init(gameInitializationEvent);

	logger.info("Reloaded successfully!");
}
 
开发者ID:AuraDevelopmentTeam,项目名称:InvSync,代码行数:15,代码来源:InventorySync.java

示例2: stop

import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void stop(GameStoppingEvent event) throws Exception {
	logger.info("Shutting down " + NAME + " Version " + VERSION);

	removeEventListeners();
	logger.debug("Unregistered events");

	dataSource = null;
	logger.debug("Closed database connection");

	config = null;
	logger.debug("Unloaded config");

	logger.info("Unloaded successfully!");
}
 
开发者ID:AuraDevelopmentTeam,项目名称:InvSync,代码行数:16,代码来源:InventorySync.java

示例3: onStopping

import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onStopping(GameStoppingEvent event) {
	if (this.useUptimes) {
		current.finish();
		uptimes.add(current);
		Store.get().get("server", false).ifPresent(Expansion::saveConfig);
	} else {
		uptimes.clear();
	}
}
 
开发者ID:rojo8399,项目名称:PlaceholderAPI,代码行数:11,代码来源:Defaults.java

示例4: onStoppingLate

import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener(order = LATE)
public void onStoppingLate(final GameStoppingEvent event) {
    ((ConfigurationManagerImpl) getServiceManager().provideUnchecked(MinigameService.class).getConfigurationManager()).saveAllConfigurations();

    // Save log file to a compressed log file and delete the log file itself.
    // Should the compressing fail, the original file should exist.
    // This should always be the last function done by the plugin.
    MinigameCoreLoggerUtil.cancelTask(this);
    MinigameCoreLoggerUtil.flush(getLogger());
    MinigameCoreLoggerUtil.compress(getLogger());
}
 
开发者ID:MinigameCore,项目名称:MinigameCore,代码行数:12,代码来源:MinigameCore.java

示例5: onDisable

import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onDisable(GameStoppingEvent event)
{
    for (UUID hiddenId : hiddenUsers)
    {
        Sponge.getServer().getPlayer(hiddenId).ifPresent(p -> this.showPlayer(p, true));
    }
    this.hiddenUsers.clear();
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:10,代码来源:Hide.java

示例6: onStop

import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onStop(GameStoppingEvent event) {
	onStop();
}
 
开发者ID:AuraDevelopmentTeam,项目名称:AuraSunDial,代码行数:5,代码来源:AuraSunDial.java

示例7: onGameStoppingserver

import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onGameStoppingserver(GameStoppingEvent event) {
    // TODO: Call onDisable in the same order as in onLoad. Cache?
}
 
开发者ID:Proximyst,项目名称:Bukkit2Sponge,代码行数:5,代码来源:Plugin.java

示例8: registerShutdownHandler

import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Override
public void registerShutdownHandler(TaskChainFactory factory) {
    Sponge.getEventManager().registerListener(plugin, GameStoppingEvent.class, event -> {
        factory.shutdown(60, TimeUnit.SECONDS);
    });
}
 
开发者ID:aikar,项目名称:TaskChain,代码行数:7,代码来源:SpongeTaskChainFactory.java

示例9: onStop

import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onStop(GameStoppingEvent event) {
	saveConfig();
	Store.get().saveAll();
}
 
开发者ID:rojo8399,项目名称:PlaceholderAPI,代码行数:6,代码来源:PlaceholderAPIPlugin.java

示例10: onStop

import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onStop(GameStoppingEvent event) throws Exception {
	getGame().getEventManager().unregisterPluginListeners(this);
}
 
开发者ID:NamelessMC,项目名称:Nameless-Plugin,代码行数:5,代码来源:NamelessPlugin.java

示例11: onGameStopping

import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onGameStopping(GameStoppingEvent event) {
    InfernoCore.getMinigames().values().forEach(mg -> mg.getRounds().forEach(Round::end));
}
 
开发者ID:caseif,项目名称:Inferno,代码行数:5,代码来源:InfernoPlugin.java

示例12: onGameStoppingEvent

import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
   public void onGameStoppingEvent(GameStoppingEvent event) throws ServerDisableException {
	disable();
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:5,代码来源:EPlugin.java

示例13: onGameStopping

import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onGameStopping(GameStoppingEvent event) {
	getLogger().info(Reference.PLUGIN_NAME + " v" + Reference.VERSION + " Has stopped.");
}
 
开发者ID:LXGaming,项目名称:AntiExploit,代码行数:5,代码来源:AntiExploit.java

示例14: onServerStopping

import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onServerStopping(GameStoppingEvent event) {
	terminateNPCs();
	saveConfigs();
	npcs.clear();
}
 
开发者ID:DosMike,项目名称:VillagerShops,代码行数:7,代码来源:VillagerShops.java

示例15: onServerStopping

import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onServerStopping(GameStoppingEvent event)
{
	Utils.saveMail();
}
 
开发者ID:hsyyid,项目名称:EssentialCmds,代码行数:6,代码来源:EssentialCmds.java


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