本文整理汇总了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!");
}
示例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!");
}
示例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();
}
}
示例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());
}
示例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();
}
示例6: onStop
import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onStop(GameStoppingEvent event) {
onStop();
}
示例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?
}
示例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);
});
}
示例9: onStop
import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onStop(GameStoppingEvent event) {
saveConfig();
Store.get().saveAll();
}
示例10: onStop
import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onStop(GameStoppingEvent event) throws Exception {
getGame().getEventManager().unregisterPluginListeners(this);
}
示例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));
}
示例12: onGameStoppingEvent
import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onGameStoppingEvent(GameStoppingEvent event) throws ServerDisableException {
disable();
}
示例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.");
}
示例14: onServerStopping
import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onServerStopping(GameStoppingEvent event) {
terminateNPCs();
saveConfigs();
npcs.clear();
}
示例15: onServerStopping
import org.spongepowered.api.event.game.state.GameStoppingEvent; //导入依赖的package包/类
@Listener
public void onServerStopping(GameStoppingEvent event)
{
Utils.saveMail();
}