forked from mirrors/NBTExplorer
Allow setting TileEntity data on blocks not explicitly registered as TE blocks
This commit is contained in:
parent
e8362682e2
commit
59ad0d3976
1 changed files with 3 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue