diff --git a/Substrate/SubstrateCS/Source/AlphaBlock.cs b/Substrate/SubstrateCS/Source/AlphaBlock.cs index d56c289..248a28e 100644 --- a/Substrate/SubstrateCS/Source/AlphaBlock.cs +++ b/Substrate/SubstrateCS/Source/AlphaBlock.cs @@ -184,7 +184,9 @@ namespace Substrate public AlphaBlock Copy () { AlphaBlock block = new AlphaBlock(_id, _data); - block._tileEntity = _tileEntity.Copy(); + if (_tileEntity != null) { + block._tileEntity = _tileEntity.Copy(); + } return block; } diff --git a/Substrate/SubstrateCS/Source/AlphaBlockCollection.cs b/Substrate/SubstrateCS/Source/AlphaBlockCollection.cs index 0176487..931154b 100644 --- a/Substrate/SubstrateCS/Source/AlphaBlockCollection.cs +++ b/Substrate/SubstrateCS/Source/AlphaBlockCollection.cs @@ -204,7 +204,10 @@ namespace Substrate SetID(x, y, z, block.ID); SetData(x, y, z, block.Data); - SetTileEntity(x, y, z, block.GetTileEntity().Copy()); + TileEntity te = block.GetTileEntity(); + if (te != null) { + SetTileEntity(x, y, z, te.Copy()); + } } #region IBoundedBlockCollection Members