本文整理汇总了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;未经允许,请勿转载。 |
请发表评论