本文整理匯總了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();
}
示例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();
}
}
}
示例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();
}
}
}
示例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();
}
示例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();
}
}