private void AssertChunk(Chunk chunk) { Assert.IsNotNull(chunk); AssertLevel(chunk.Level); }
public void SaveChunkTest() { var chunk = new Chunk() { Level = new Level() { BlockLight = new BlockLight() { Length = 32768, Values = new byte[32768], }, Blocks = new Blocks() { Length = 32768, BlockIds = new byte[32768], }, Data = new Data() { Length = 32768, Values = new byte[32768], }, Entities = new Entities() { EntityList = new List<Entity>(), }, HeightMap = new HeightMap() { Length = 256, RawHeightData = new byte[256], }, LastUpdate = 327730, SkyLight = new SkyLight() { Length = 32768, Values = new byte[32768], }, TerrainPopulated = 1, TileEntities = new TileEntities() { TileEntityList = new List<TileEntity>(), }, XPos = 0, ZPos = 0, }, }; chunk.Save(@"..\..\TestFiles\c.0.0.dat.out"); var loaded = Chunk.Load(@"..\..\TestFiles\c.0.0.dat.out"); AssertChunk(loaded); }
public static Chunk Load(string filePath) { var tag = (CompoundTag)NbtFile.Load(filePath); var chunk = new Chunk(tag); return chunk; }