當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。