Allow setting TileEntity data on blocks not explicitly registered as TE blocks

This commit is contained in:
Justin Aquadro 2013-05-22 01:07:53 -04:00
parent e8362682e2
commit 59ad0d3976

View file

@ -49,12 +49,9 @@ namespace Substrate.Core
public void SetTileEntity (int x, int y, int z, TileEntity te)
{
BlockInfoEx info = BlockInfo.BlockTable[_blocks[x, y, z]] as BlockInfoEx;
if (info == null) {
throw new InvalidOperationException("The given block is of a type that does not support TileEntities.");
}
if (te.GetType() != TileEntityFactory.Lookup(info.TileEntityName)) {
throw new ArgumentException("The TileEntity type is not valid for this block.", "te");
if (info != null) {
if (te.GetType() != TileEntityFactory.Lookup(info.TileEntityName))
throw new ArgumentException("The TileEntity type is not valid for this block.", "te");
}
BlockKey key = (TranslateCoordinates != null)