本文整理汇总了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();
}
}