A bunch of bugfixes

This commit is contained in:
Justin Aquadro 2012-04-28 20:34:22 -04:00
parent 09d51e6f16
commit 2b6dec51bf
10 changed files with 45 additions and 27 deletions

View file

@ -30,8 +30,8 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.2.1.0")]
[assembly: AssemblyFileVersion("1.2.1.0")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
// This library is compatible with all CLS-compliant .NET programming languages.
[assembly: CLSCompliant(true)]

View file

@ -94,10 +94,8 @@ namespace Substrate
return GetPlayerManagerVirt() as PlayerManager;
}
/// <summary>
/// Saves the world's <see cref="Level"/> data, and any <see cref="IChunk"/> objects known to have unsaved changes.
/// </summary>
public void Save ()
/// <inherits />
public override void Save ()
{
_level.Save();
@ -217,6 +215,7 @@ namespace Substrate
Path = path;
_level = new Level(this);
_level.Version = 0;
return this;
}

View file

@ -7,7 +7,7 @@ namespace Substrate
{
public class AnvilRegion : Region
{
private static Regex _namePattern = new Regex("r\\.(-?[0-9]+)\\.(-?[0-9]+)\\.mcr$");
private static Regex _namePattern = new Regex("r\\.(-?[0-9]+)\\.(-?[0-9]+)\\.mca$");
public AnvilRegion (AnvilRegionManager rm, ChunkCache cache, int rx, int rz)
: base(rm, cache, rx, rz)
@ -17,7 +17,7 @@ namespace Substrate
/// <inherits />
public override string GetFileName ()
{
return "r." + _rx + "." + _rz + ".mcr";
return "r." + _rx + "." + _rz + ".mca";
}
@ -71,12 +71,12 @@ namespace Substrate
protected override IChunk CreateChunkCore (int cx, int cz)
{
return AlphaChunk.Create(cz, cz);
return AnvilChunk.Create(cz, cz);
}
protected override IChunk CreateChunkVerifiedCore (NbtTree tree)
{
return AlphaChunk.CreateVerified(tree);
return AnvilChunk.CreateVerified(tree);
}
}
}

View file

@ -144,10 +144,8 @@ namespace Substrate
return GetDataManagerVirt() as BetaDataManager;
}
/// <summary>
/// Saves the world's <see cref="Level"/> data, and any <see cref="IChunk"/> objects known to have unsaved changes.
/// </summary>
public void Save ()
/// <inherits />
public override void Save ()
{
_level.Save();

View file

@ -144,10 +144,8 @@ namespace Substrate
return GetDataManagerVirt() as BetaDataManager;
}
/// <summary>
/// Saves the world's <see cref="Level"/> data, and any <see cref="IChunk"/> objects known to have unsaved changes.
/// </summary>
public void Save ()
/// <inherits />
public override void Save ()
{
_level.Save();
@ -345,6 +343,7 @@ namespace Substrate
Path = path;
_level = new Level(this);
_level.Version = 19132;
return this;
}

View file

@ -293,7 +293,7 @@ namespace Substrate.Core
int cx = lcx + _rx * XDIM;
int cz = lcz + _rz * ZDIM;
AlphaChunk c = AlphaChunk.Create(cx, cz);
IChunk c = CreateChunkCore(cx, cz);
c.Save(GetChunkOutStream(lcx, lcz));
ChunkRef cr = ChunkRef.Create(this, lcx, lcz);

View file

@ -46,7 +46,7 @@ namespace Substrate.Core
try {
if (_cache.TryGetValue(k, out r) == false) {
r = CreateRegionCore(rz, rz);
r = CreateRegionCore(rx, rz);
_cache.Add(k, r);
}
return r;

View file

@ -136,6 +136,11 @@ namespace Substrate
return null;
}
/// <summary>
/// Saves the world's <see cref="Level"/> data, and any <see cref="IChunk"/> objects known to have unsaved changes.
/// </summary>
public abstract void Save ();
/// <summary>
/// Raised when <see cref="Open"/> is called, used to find a concrete <see cref="NbtWorld"/> type that can open the world.
/// </summary>

View file

@ -61,7 +61,15 @@
<ItemGroup>
<Compile Include="Source\AlphaWorld.cs" />
<Compile Include="Source\AnvilChunk.cs" />
<Compile Include="Source\BetaChunkManager.cs" />
<Compile Include="Source\AnvilRegion.cs" />
<Compile Include="Source\AnvilRegionManager.cs" />
<Compile Include="Source\AnvilSection.cs" />
<Compile Include="Source\AnvilWorld.cs" />
<Compile Include="Source\BetaRegionManager.cs" />
<Compile Include="Source\Core\CompositeByteArray.cs" />
<Compile Include="Source\Core\CompositeNibbleArray.cs" />
<Compile Include="Source\RegionChunkManager.cs" />
<Compile Include="Source\BetaRegion.cs" />
<Compile Include="Source\BetaWorld.cs" />
<Compile Include="Source\BiomeInfo.cs" />
<Compile Include="Source\Core\BlockTileTicks.cs" />
@ -153,7 +161,7 @@
<Compile Include="Source\Core\BlockInterface.cs" />
<Compile Include="Source\Core\BlockKey.cs" />
<Compile Include="Source\BlockManager.cs" />
<None Include="Source\Chunk.cs" />
<Compile Include="Source\AlphaChunk.cs" />
<Compile Include="Source\Core\ChunkFile.cs" />
<Compile Include="Source\AlphaChunkManager.cs" />
<Compile Include="Source\Core\ChunkInterface.cs" />
@ -192,10 +200,10 @@
<Compile Include="Source\Core\NBTFile.cs" />
<Compile Include="Source\NBT\JSONSerializer.cs" />
<Compile Include="Source\Player.cs" />
<Compile Include="Source\Region.cs" />
<Compile Include="Source\Core\Region.cs" />
<Compile Include="Source\Core\RegionFile.cs" />
<Compile Include="Source\Core\RegionKey.cs" />
<Compile Include="Source\RegionManager.cs" />
<Compile Include="Source\Core\RegionManager.cs" />
<Compile Include="Source\SpawnPoint.cs" />
<Compile Include="Source\SubstrateException.cs" />
<Compile Include="Source\TileEntities\TileEntityBrewingStand.cs" />

View file

@ -59,14 +59,24 @@
<Reference Include="System.Drawing" />
</ItemGroup>
<ItemGroup>
<Compile Include="Source\AlphaChunk.cs" />
<Compile Include="Source\AlphaWorld.cs" />
<Compile Include="Source\AnvilChunk.cs" />
<Compile Include="Source\BetaChunkManager.cs" />
<Compile Include="Source\AnvilRegion.cs" />
<Compile Include="Source\AnvilRegionManager.cs" />
<Compile Include="Source\AnvilSection.cs" />
<Compile Include="Source\AnvilWorld.cs" />
<Compile Include="Source\BetaRegion.cs" />
<Compile Include="Source\BetaRegionManager.cs" />
<Compile Include="Source\BetaWorld.cs" />
<Compile Include="Source\BiomeInfo.cs" />
<Compile Include="Source\Core\BlockTileTicks.cs" />
<Compile Include="Source\Core\BoundedBlockInterface.cs" />
<Compile Include="Source\Core\CompositeByteArray.cs" />
<Compile Include="Source\Core\CompositeNibbleArray.cs" />
<Compile Include="Source\Core\ItemInterface.cs" />
<Compile Include="Source\Core\Region.cs" />
<Compile Include="Source\Core\RegionManager.cs" />
<Compile Include="Source\Data\BetaDataManager.cs" />
<Compile Include="Source\Data\DataExceptions.cs" />
<Compile Include="Source\Data\MapFile.cs" />
@ -192,10 +202,9 @@
<Compile Include="Source\Core\NBTFile.cs" />
<Compile Include="Source\NBT\JSONSerializer.cs" />
<Compile Include="Source\Player.cs" />
<Compile Include="Source\Region.cs" />
<Compile Include="Source\Core\RegionFile.cs" />
<Compile Include="Source\Core\RegionKey.cs" />
<Compile Include="Source\RegionManager.cs" />
<Compile Include="Source\RegionChunkManager.cs" />
<Compile Include="Source\SpawnPoint.cs" />
<Compile Include="Source\SubstrateException.cs" />
<Compile Include="Source\TileEntities\TileEntityBrewingStand.cs" />