本文整理汇总了C#中CraftyServer.Core.World.getWorldInfo方法的典型用法代码示例。如果您正苦于以下问题:C# World.getWorldInfo方法的具体用法?C# World.getWorldInfo怎么用?C# World.getWorldInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CraftyServer.Core.World
的用法示例。
在下文中一共展示了World.getWorldInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: saveChunk
public void saveChunk(World world, Chunk chunk)
{
world.checkSessionLock();
try
{
DataOutputStream dataoutputstream = RegionFileCache.func_22120_d(field_22110_a, chunk.xPosition,
chunk.zPosition);
var nbttagcompound = new NBTTagCompound();
var nbttagcompound1 = new NBTTagCompound();
nbttagcompound.setTag("Level", nbttagcompound1);
ChunkLoader.storeChunkInCompound(chunk, world, nbttagcompound1);
CompressedStreamTools.func_771_a(nbttagcompound, dataoutputstream);
dataoutputstream.close();
WorldInfo worldinfo = world.getWorldInfo();
worldinfo.func_22177_b(worldinfo.func_22182_g() +
RegionFileCache.func_22121_b(field_22110_a, chunk.xPosition, chunk.zPosition));
}
catch (Exception exception)
{
exception.printStackTrace();
}
}
示例2: saveChunk
public void saveChunk(World world, Chunk chunk)
{
world.checkSessionLock();
File file = chunkFileForXZ(chunk.xPosition, chunk.zPosition);
if (file.exists())
{
WorldInfo worldinfo = world.getWorldInfo();
worldinfo.func_22177_b(worldinfo.func_22182_g() - file.length());
}
try
{
var file1 = new File(saveDir, "tmp_chunk.dat");
var fileoutputstream = new FileOutputStream(file1);
var nbttagcompound = new NBTTagCompound();
var nbttagcompound1 = new NBTTagCompound();
nbttagcompound.setTag("Level", nbttagcompound1);
storeChunkInCompound(chunk, world, nbttagcompound1);
CompressedStreamTools.writeGzippedCompoundToOutputStream(nbttagcompound, fileoutputstream);
fileoutputstream.close();
if (file.exists())
{
file.delete();
}
file1.renameTo(file);
WorldInfo worldinfo1 = world.getWorldInfo();
worldinfo1.func_22177_b(worldinfo1.func_22182_g() + file.length());
}
catch (Exception exception)
{
exception.printStackTrace();
}
}