forked from mirrors/NBTExplorer
A bunch of bugfixes
This commit is contained in:
parent
09d51e6f16
commit
2b6dec51bf
10 changed files with 45 additions and 27 deletions
|
@ -30,8 +30,8 @@ using System.Runtime.InteropServices;
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
[assembly: AssemblyVersion("1.2.1.0")]
|
[assembly: AssemblyVersion("1.3.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.2.1.0")]
|
[assembly: AssemblyFileVersion("1.3.0.0")]
|
||||||
|
|
||||||
// This library is compatible with all CLS-compliant .NET programming languages.
|
// This library is compatible with all CLS-compliant .NET programming languages.
|
||||||
[assembly: CLSCompliant(true)]
|
[assembly: CLSCompliant(true)]
|
|
@ -94,10 +94,8 @@ namespace Substrate
|
||||||
return GetPlayerManagerVirt() as PlayerManager;
|
return GetPlayerManagerVirt() as PlayerManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inherits />
|
||||||
/// Saves the world's <see cref="Level"/> data, and any <see cref="IChunk"/> objects known to have unsaved changes.
|
public override void Save ()
|
||||||
/// </summary>
|
|
||||||
public void Save ()
|
|
||||||
{
|
{
|
||||||
_level.Save();
|
_level.Save();
|
||||||
|
|
||||||
|
@ -217,6 +215,7 @@ namespace Substrate
|
||||||
|
|
||||||
Path = path;
|
Path = path;
|
||||||
_level = new Level(this);
|
_level = new Level(this);
|
||||||
|
_level.Version = 0;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace Substrate
|
||||||
{
|
{
|
||||||
public class AnvilRegion : Region
|
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)
|
public AnvilRegion (AnvilRegionManager rm, ChunkCache cache, int rx, int rz)
|
||||||
: base(rm, cache, rx, rz)
|
: base(rm, cache, rx, rz)
|
||||||
|
@ -17,7 +17,7 @@ namespace Substrate
|
||||||
/// <inherits />
|
/// <inherits />
|
||||||
public override string GetFileName ()
|
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)
|
protected override IChunk CreateChunkCore (int cx, int cz)
|
||||||
{
|
{
|
||||||
return AlphaChunk.Create(cz, cz);
|
return AnvilChunk.Create(cz, cz);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IChunk CreateChunkVerifiedCore (NbtTree tree)
|
protected override IChunk CreateChunkVerifiedCore (NbtTree tree)
|
||||||
{
|
{
|
||||||
return AlphaChunk.CreateVerified(tree);
|
return AnvilChunk.CreateVerified(tree);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,10 +144,8 @@ namespace Substrate
|
||||||
return GetDataManagerVirt() as BetaDataManager;
|
return GetDataManagerVirt() as BetaDataManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inherits />
|
||||||
/// Saves the world's <see cref="Level"/> data, and any <see cref="IChunk"/> objects known to have unsaved changes.
|
public override void Save ()
|
||||||
/// </summary>
|
|
||||||
public void Save ()
|
|
||||||
{
|
{
|
||||||
_level.Save();
|
_level.Save();
|
||||||
|
|
||||||
|
|
|
@ -144,10 +144,8 @@ namespace Substrate
|
||||||
return GetDataManagerVirt() as BetaDataManager;
|
return GetDataManagerVirt() as BetaDataManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inherits />
|
||||||
/// Saves the world's <see cref="Level"/> data, and any <see cref="IChunk"/> objects known to have unsaved changes.
|
public override void Save ()
|
||||||
/// </summary>
|
|
||||||
public void Save ()
|
|
||||||
{
|
{
|
||||||
_level.Save();
|
_level.Save();
|
||||||
|
|
||||||
|
@ -345,6 +343,7 @@ namespace Substrate
|
||||||
|
|
||||||
Path = path;
|
Path = path;
|
||||||
_level = new Level(this);
|
_level = new Level(this);
|
||||||
|
_level.Version = 19132;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -293,7 +293,7 @@ namespace Substrate.Core
|
||||||
int cx = lcx + _rx * XDIM;
|
int cx = lcx + _rx * XDIM;
|
||||||
int cz = lcz + _rz * ZDIM;
|
int cz = lcz + _rz * ZDIM;
|
||||||
|
|
||||||
AlphaChunk c = AlphaChunk.Create(cx, cz);
|
IChunk c = CreateChunkCore(cx, cz);
|
||||||
c.Save(GetChunkOutStream(lcx, lcz));
|
c.Save(GetChunkOutStream(lcx, lcz));
|
||||||
|
|
||||||
ChunkRef cr = ChunkRef.Create(this, lcx, lcz);
|
ChunkRef cr = ChunkRef.Create(this, lcx, lcz);
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace Substrate.Core
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (_cache.TryGetValue(k, out r) == false) {
|
if (_cache.TryGetValue(k, out r) == false) {
|
||||||
r = CreateRegionCore(rz, rz);
|
r = CreateRegionCore(rx, rz);
|
||||||
_cache.Add(k, r);
|
_cache.Add(k, r);
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
|
|
|
@ -136,6 +136,11 @@ namespace Substrate
|
||||||
return null;
|
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>
|
/// <summary>
|
||||||
/// Raised when <see cref="Open"/> is called, used to find a concrete <see cref="NbtWorld"/> type that can open the world.
|
/// Raised when <see cref="Open"/> is called, used to find a concrete <see cref="NbtWorld"/> type that can open the world.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -61,7 +61,15 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Source\AlphaWorld.cs" />
|
<Compile Include="Source\AlphaWorld.cs" />
|
||||||
<Compile Include="Source\AnvilChunk.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\BetaWorld.cs" />
|
||||||
<Compile Include="Source\BiomeInfo.cs" />
|
<Compile Include="Source\BiomeInfo.cs" />
|
||||||
<Compile Include="Source\Core\BlockTileTicks.cs" />
|
<Compile Include="Source\Core\BlockTileTicks.cs" />
|
||||||
|
@ -153,7 +161,7 @@
|
||||||
<Compile Include="Source\Core\BlockInterface.cs" />
|
<Compile Include="Source\Core\BlockInterface.cs" />
|
||||||
<Compile Include="Source\Core\BlockKey.cs" />
|
<Compile Include="Source\Core\BlockKey.cs" />
|
||||||
<Compile Include="Source\BlockManager.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\Core\ChunkFile.cs" />
|
||||||
<Compile Include="Source\AlphaChunkManager.cs" />
|
<Compile Include="Source\AlphaChunkManager.cs" />
|
||||||
<Compile Include="Source\Core\ChunkInterface.cs" />
|
<Compile Include="Source\Core\ChunkInterface.cs" />
|
||||||
|
@ -192,10 +200,10 @@
|
||||||
<Compile Include="Source\Core\NBTFile.cs" />
|
<Compile Include="Source\Core\NBTFile.cs" />
|
||||||
<Compile Include="Source\NBT\JSONSerializer.cs" />
|
<Compile Include="Source\NBT\JSONSerializer.cs" />
|
||||||
<Compile Include="Source\Player.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\RegionFile.cs" />
|
||||||
<Compile Include="Source\Core\RegionKey.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\SpawnPoint.cs" />
|
||||||
<Compile Include="Source\SubstrateException.cs" />
|
<Compile Include="Source\SubstrateException.cs" />
|
||||||
<Compile Include="Source\TileEntities\TileEntityBrewingStand.cs" />
|
<Compile Include="Source\TileEntities\TileEntityBrewingStand.cs" />
|
||||||
|
|
|
@ -59,14 +59,24 @@
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="Source\AlphaChunk.cs" />
|
||||||
<Compile Include="Source\AlphaWorld.cs" />
|
<Compile Include="Source\AlphaWorld.cs" />
|
||||||
<Compile Include="Source\AnvilChunk.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\BetaWorld.cs" />
|
||||||
<Compile Include="Source\BiomeInfo.cs" />
|
<Compile Include="Source\BiomeInfo.cs" />
|
||||||
<Compile Include="Source\Core\BlockTileTicks.cs" />
|
<Compile Include="Source\Core\BlockTileTicks.cs" />
|
||||||
<Compile Include="Source\Core\BoundedBlockInterface.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\ItemInterface.cs" />
|
||||||
|
<Compile Include="Source\Core\Region.cs" />
|
||||||
|
<Compile Include="Source\Core\RegionManager.cs" />
|
||||||
<Compile Include="Source\Data\BetaDataManager.cs" />
|
<Compile Include="Source\Data\BetaDataManager.cs" />
|
||||||
<Compile Include="Source\Data\DataExceptions.cs" />
|
<Compile Include="Source\Data\DataExceptions.cs" />
|
||||||
<Compile Include="Source\Data\MapFile.cs" />
|
<Compile Include="Source\Data\MapFile.cs" />
|
||||||
|
@ -192,10 +202,9 @@
|
||||||
<Compile Include="Source\Core\NBTFile.cs" />
|
<Compile Include="Source\Core\NBTFile.cs" />
|
||||||
<Compile Include="Source\NBT\JSONSerializer.cs" />
|
<Compile Include="Source\NBT\JSONSerializer.cs" />
|
||||||
<Compile Include="Source\Player.cs" />
|
<Compile Include="Source\Player.cs" />
|
||||||
<Compile Include="Source\Region.cs" />
|
|
||||||
<Compile Include="Source\Core\RegionFile.cs" />
|
<Compile Include="Source\Core\RegionFile.cs" />
|
||||||
<Compile Include="Source\Core\RegionKey.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\SpawnPoint.cs" />
|
||||||
<Compile Include="Source\SubstrateException.cs" />
|
<Compile Include="Source\SubstrateException.cs" />
|
||||||
<Compile Include="Source\TileEntities\TileEntityBrewingStand.cs" />
|
<Compile Include="Source\TileEntities\TileEntityBrewingStand.cs" />
|
||||||
|
|
Loading…
Reference in a new issue