diff --git a/SubstrateCS/Properties/AssemblyInfo.cs b/SubstrateCS/Properties/AssemblyInfo.cs index f296881..7d71888 100644 --- a/SubstrateCS/Properties/AssemblyInfo.cs +++ b/SubstrateCS/Properties/AssemblyInfo.cs @@ -30,8 +30,8 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("1.2.0.0")] -[assembly: AssemblyFileVersion("1.2.0.0")] +[assembly: AssemblyVersion("1.2.1.0")] +[assembly: AssemblyFileVersion("1.2.1.0")] // This library is compatible with all CLS-compliant .NET programming languages. [assembly: CLSCompliant(true)] \ No newline at end of file diff --git a/SubstrateCS/Source/AnvilChunk.cs b/SubstrateCS/Source/AnvilChunk.cs index fbdd62f..f4a07b5 100644 --- a/SubstrateCS/Source/AnvilChunk.cs +++ b/SubstrateCS/Source/AnvilChunk.cs @@ -427,7 +427,7 @@ namespace Substrate new SchemaNodeScaler("Y", TagType.TAG_BYTE), new SchemaNodeArray("AddBlocks", 2048, SchemaOptions.OPTIONAL), }), - new SchemaNodeArray("Biomes", 256), + new SchemaNodeArray("Biomes", 256, SchemaOptions.OPTIONAL), new SchemaNodeIntArray("HeightMap", 256), new SchemaNodeList("Entities", TagType.TAG_COMPOUND, SchemaOptions.CREATE_ON_MISSING), new SchemaNodeList("TileEntities", TagType.TAG_COMPOUND, TileEntity.Schema, SchemaOptions.CREATE_ON_MISSING), @@ -657,7 +657,16 @@ namespace Substrate _blockLight = new CompositeYZXNibbleArray(blockLightBA); _heightMap = new ZXIntArray(XDIM, ZDIM, level["HeightMap"] as TagNodeIntArray); - _biomes = new ZXByteArray(XDIM, ZDIM, level["Biomes"] as TagNodeByteArray); + + if (level.ContainsKey("Biomes")) + _biomes = new ZXByteArray(XDIM, ZDIM, level["Biomes"] as TagNodeByteArray); + else { + level["Biomes"] = new TagNodeByteArray(new byte[256]); + _biomes = new ZXByteArray(XDIM, ZDIM, level["Biomes"] as TagNodeByteArray); + for (int x = 0; x < XDIM; x++) + for (int z = 0; z < ZDIM; z++) + _biomes[x, z] = BiomeType.Default; + } _entities = level["Entities"] as TagNodeList; _tileEntities = level["TileEntities"] as TagNodeList;