• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java FMLServerStoppingEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: unloadAll

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
public static void unloadAll(FMLServerStoppingEvent serverStoppingEvent) {
    File worldFile = new File(FMLCommonHandler.instance().getSavesDirectory(), FMLCommonHandler.instance().getMinecraftServerInstance().getFolderName());
    File dataFile = new File(worldFile, fileName);

    if (dimDataList == null || dimDataList.isEmpty()) {
        return;
    }
    Gson gson = new GsonBuilder().setPrettyPrinting().create();
    String json = gson.toJson(dimDataList);
    try {
        if (dataFile.exists()) {
            dataFile.delete();
        }
        FileUtils.writeStringToFile(dataFile, json);
    } catch (IOException e) {
        e.printStackTrace();
    }

    for (DimData data : dimDataList) {
        DimensionManager.unloadWorld(data.id);
        DimensionManager.unregisterDimension(data.id);
    }
    dimDataList.clear();
    dimDataHashMap.clear();
}
 
开发者ID:modmuss50,项目名称:TechnicalDimensions,代码行数:26,代码来源:ModDimensions.java


示例2: serverStopping

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
public void serverStopping(FMLServerStoppingEvent event) {
    // cancel running tasks
    SessionManager.getInstance().getAllSessions().forEachRemaining(sess -> {
        sess.taskManager.cancelTasks();
    });
    SessionManager.getInstance().clearAllSessions();
}
 
开发者ID:kenzierocks,项目名称:HardVox,代码行数:9,代码来源:HardVox.java


示例3: serverStopping

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
    if (!CreeperHost.instance.active)
        return;
    serverOn = false;
    serializePreload();
    pregenTasks.clear();
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:10,代码来源:CreeperHostServer.java


示例4: serverStop

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@Mod.EventHandler
public void serverStop(FMLServerStoppingEvent event) {
	//MapList.nameToData.clear();
	//MapList.buildInAttributes.clear();

	File output = new File(((AnvilSaveConverter) server.getActiveAnvilConverter()).savesDirectory, server.getFolderName() + "/teleports.dat");
	NBTTagCompound tagRoot = new NBTTagCompound();
	NBTTagCompound tag = new NBTTagCompound();
	tagRoot.setTag("Teleporters", tag);

	for (Entry<UUID, TeleporterData[]> entry : EntityTeleporter.teleporters.entrySet()) {
		NBTTagCompound exitTag = new NBTTagCompound();
		for (int i = 0; i < EntityTeleporter.TP_PER_PLAYER; i++) {
			TeleporterData blockPos = entry.getValue()[i];
			if (blockPos != null)
				exitTag.setIntArray(Integer.toString(i), new int[] { blockPos.getX(), blockPos.getY(), blockPos.getZ(), blockPos.id, blockPos.dimension});
		}
		tag.setTag(entry.getKey().toString(), exitTag);
	}
	tagRoot.setInteger("TPCount", EntityTeleporter.tpCount);

	try {
		CompressedStreamTools.writeCompressed(tagRoot, new FileOutputStream(output));
	} catch (IOException e) {
		e.printStackTrace();
	}

	EntityTeleporter.teleporters.clear();
	EntityTeleporter.tpCount = 0;
	if(udpServer != null) {
		udpServer.stopServer();
		udpServer = null;
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:35,代码来源:TF2weapons.java


示例5: serverStop

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@Mod.EventHandler
@SideOnly(Side.SERVER)
public void serverStop(FMLServerStoppingEvent event)
{
    DynMapFeatures.removeAllBorders();
    Config.storeFillTask();
}
 
开发者ID:abused,项目名称:World-Border,代码行数:8,代码来源:WorldBorder.java


示例6: onServerStop

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
public static void onServerStop(FMLServerStoppingEvent event) {
	log.info("Stopping the Server");
	PlayerHandler.cleanup();
	if (isMapEnabled)
		Minimap.close();
	WorldHandler.stopServer();
	TomsModUtils.setServer(null);
	log.info("Server Stopped");
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:11,代码来源:CoreInit.java


示例7: serverStopping

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
	// Calling this method destroys all server instances that exist,
	// because the 'event' given above does NOT give us the server-instance that is being stopped.
	ServerHandler.destroyServerMirror(null);
}
 
开发者ID:tiffit,项目名称:TaleCraft,代码行数:8,代码来源:TaleCraft.java


示例8: onServerStopping

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@Mod.EventHandler
public void onServerStopping(FMLServerStoppingEvent event){
	if(event.getSide()==Side.CLIENT){
		//when the server stops (hopefully this is the right event), save the state of the clock
		ModLogger.logInfo("Saving clock state for the next reload");
		ConfigurationHandler.setValueDisplay(Clock.isEnabled());
	}
}
 
开发者ID:Xilef11,项目名称:MC-realTimeClock,代码行数:9,代码来源:RealTimeClock.java


示例9: onServerStopping

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
@SideOnly(Side.SERVER)
public void onServerStopping(FMLServerStoppingEvent event)
{
    if (senderConnected)
    {
        slackSender.sendToSlack(SlackCommandSender.getInstance(), Messages.General.SERVER_STOPPED);
    }
}
 
开发者ID:compwiz1548,项目名称:SlackMC,代码行数:10,代码来源:Slack.java


示例10: serverStop

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
public void serverStop(FMLServerStoppingEvent event)
{
	log.info("[Cannibalism] Writing playerdata to file...");
	io.write(data.getDatabase());
	log.info("[Cannibalism] Completed");

}
 
开发者ID:SoraZodia,项目名称:Cannibalism,代码行数:9,代码来源:Cannibalism.java


示例11: onServerStopping

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
public void onServerStopping(FMLServerStoppingEvent event){
	_dal.stopAllThreads();
	
	for (WorldServer ws : MinecraftServer.getServer().worldServers){
		ClaimManager.instance.saveAllClaims(ws);
	}
}
 
开发者ID:Mithion,项目名称:GriefGuardian,代码行数:9,代码来源:GriefGuardian.java


示例12: serverStopping

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
  public void serverStopping(FMLServerStoppingEvent event)
  {
SaveHandler.saveFactionsToFile();
  }
 
开发者ID:Domochevsky,项目名称:minecraft-territorialdealings,代码行数:6,代码来源:Main.java


示例13: serverStopping

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
  public void serverStopping(FMLServerStoppingEvent event)
  {
SaveHandler.saveFactionsToFile(Main.configDir, Main.worldDir, TerritoryHandler.getSaveData());
  }
 
开发者ID:Domochevsky,项目名称:minecraft-territorialdealings,代码行数:6,代码来源:Main.java


示例14: serverStopping

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
public void serverStopping(@Nonnull final FMLServerStoppingEvent event) {
	proxy.serverStopping(event);
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:5,代码来源:DSurround.java


示例15: serverStopping

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
    CommonProxy.manager.reset();
}
 
开发者ID:mchorse,项目名称:blockbuster,代码行数:6,代码来源:Blockbuster.java


示例16: serverStopping

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
    eventHandlerServer.headlessHarmer.clear();
    eventHandlerServer.headlessTime.clear();
}
 
开发者ID:iChun,项目名称:Mob-Amputation,代码行数:7,代码来源:MobAmputation.java


示例17: serverStopping

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@Mod.EventHandler
public void serverStopping(final FMLServerStoppingEvent event) {
    proxy.serverStopping(event);
}
 
开发者ID:Lunatrius,项目名称:Tracer,代码行数:5,代码来源:Tracer.java


示例18: serverStopping

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
/**
 * Called from the main mod class to do stuff before the server is stopping
 */
protected void serverStopping(FMLServerStoppingEvent event) {
	this.handler.onStateEvent(event);
}
 
开发者ID:MrNobody98,项目名称:morecommands,代码行数:7,代码来源:CommonProxy.java


示例19: serverStopping

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event) {
	Game.events().publish(new ServerEvent.Stop());
}
 
开发者ID:NOVA-Team,项目名称:NOVA-Core,代码行数:5,代码来源:NovaMinecraft.java


示例20: onServerStopping

import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@Mod.EventHandler
public void onServerStopping(FMLServerStoppingEvent event)
{
    BarkHelper.cooldown.clear();
    BarkHelper.pressState.clear();
}
 
开发者ID:iChun,项目名称:BeeBarker,代码行数:7,代码来源:BeeBarker.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Eh107Configuration类代码示例发布时间:2022-05-21
下一篇:
Java ChatPaginator类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap