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


Java WorldServer.flush方法代码示例

本文整理汇总了Java中net.minecraft.world.WorldServer.flush方法的典型用法代码示例。如果您正苦于以下问题:Java WorldServer.flush方法的具体用法?Java WorldServer.flush怎么用?Java WorldServer.flush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.WorldServer的用法示例。


在下文中一共展示了WorldServer.flush方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deleteWorldAndStopServer

import net.minecraft.world.WorldServer; //导入方法依赖的package包/类
/**
 * WARNING : directly calls
 * getActiveAnvilConverter().deleteWorldDirectory(theWorldServer[0].getSaveHandler().getWorldDirectoryName());
 */
public void deleteWorldAndStopServer()
{
    this.worldIsBeingDeleted = true;
    this.getActiveAnvilConverter().flushCache();

    for (int i = 0; i < this.worldServers.length; ++i)
    {
        WorldServer worldserver = this.worldServers[i];

        if (worldserver != null)
        {
            worldserver.flush();
        }
    }

    this.getActiveAnvilConverter().deleteWorldDirectory(this.worldServers[0].getSaveHandler().getWorldDirectoryName());
    this.initiateShutdown();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:23,代码来源:MinecraftServer.java

示例2: stopServer

import net.minecraft.world.WorldServer; //导入方法依赖的package包/类
/**
 * Saves all necessary data as preparation for stopping the server.
 */
protected void stopServer()
{
    if (!this.worldIsBeingDeleted)
    {
        logger.info("Stopping server");

        if (this.getNetworkSystem() != null)
        {
            this.getNetworkSystem().terminateEndpoints();
        }

        if (this.serverConfigManager != null)
        {
            logger.info("Saving players");
            this.serverConfigManager.saveAllPlayerData();
            this.serverConfigManager.removeAllPlayers();
        }

        if (this.worldServers != null)
        {
            logger.info("Saving worlds");
            this.saveAllWorlds(false);

            for (int i = 0; i < this.worldServers.length; ++i)
            {
                WorldServer worldserver = this.worldServers[i];
                worldserver.flush();
            }
        }

        if (this.usageSnooper.isSnooperRunning())
        {
            this.usageSnooper.stopSnooper();
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:40,代码来源:MinecraftServer.java

示例3: stopServer

import net.minecraft.world.WorldServer; //导入方法依赖的package包/类
/**
 * Saves all necessary data as preparation for stopping the server.
 */
public void stopServer()
{
    if (!this.worldIsBeingDeleted)
    {
        logger.info("Stopping server");

        if (this.getNetworkSystem() != null)
        {
            this.getNetworkSystem().terminateEndpoints();
        }

        if (this.serverConfigManager != null)
        {
            logger.info("Saving players");
            this.serverConfigManager.saveAllPlayerData();
            this.serverConfigManager.removeAllPlayers();
        }

        if (this.worldServers != null)
        {
            logger.info("Saving worlds");
            this.saveAllWorlds(false);

            for (int i = 0; i < this.worldServers.length; ++i)
            {
                WorldServer worldserver = this.worldServers[i];
                worldserver.flush();
            }
        }

        if (this.usageSnooper.isSnooperRunning())
        {
            this.usageSnooper.stopSnooper();
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:40,代码来源:MinecraftServer.java

示例4: unloadWorlds

import net.minecraft.world.WorldServer; //导入方法依赖的package包/类
public static void unloadWorlds(Hashtable<Integer, long[]> worldTickTimes) {
    for (int id : unloadQueue) {
        WorldServer w = worlds.get(id);
        try {
            if (w != null)
            {
                w.saveAllChunks(true, null);
            }
            else
            {
                FMLLog.warning("Unexpected world unload - world %d is already unloaded", id);
            }
        } catch (MinecraftException e) {
            e.printStackTrace();
        }
        finally
        {
            if (w != null)
            {
                MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(w));
                w.flush();
                setWorld(id, null, w.getMinecraftServer());
            }
        }
    }
    unloadQueue.clear();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:DimensionManager.java

示例5: stopServer

import net.minecraft.world.WorldServer; //导入方法依赖的package包/类
/**
 * Saves all necessary data as preparation for stopping the server.
 */
public void stopServer()
{
    LOG.info("Stopping server");

    if (this.getNetworkSystem() != null)
    {
        this.getNetworkSystem().terminateEndpoints();
    }

    if (this.playerList != null)
    {
        LOG.info("Saving players");
        this.playerList.saveAllPlayerData();
        this.playerList.removeAllPlayers();
    }

    if (this.worldServers != null)
    {
        LOG.info("Saving worlds");

        for (WorldServer worldserver : this.worldServers)
        {
            if (worldserver != null)
            {
                worldserver.disableLevelSaving = false;
            }
        }

        this.saveAllWorlds(false);

        for (WorldServer worldserver1 : this.worldServers)
        {
            if (worldserver1 != null)
            {
                worldserver1.flush();
            }
        }
    }

    if (this.usageSnooper.isSnooperRunning())
    {
        this.usageSnooper.stopSnooper();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:48,代码来源:MinecraftServer.java


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