/// <summary> /// Crrates a new <see cref="AlphaBlock"/> from a given block in an existing <see cref="AlphaBlockCollection"/>. /// </summary> /// <param name="chunk">The block collection to reference.</param> /// <param name="lx">The local X-coordinate of a block within the collection.</param> /// <param name="ly">The local Y-coordinate of a block within the collection.</param> /// <param name="lz">The local Z-coordinate of a block within the collection.</param> public AlphaBlock(AlphaBlockCollection chunk, int lx, int ly, int lz) { _id = chunk.GetID(lx, ly, lz); _data = chunk.GetData(lx, ly, lz); TileEntity te = chunk.GetTileEntity(lx, ly, lz); if (te != null) { _tileEntity = te.Copy(); } }
/// <summary> /// Gets the Tile Entity record of the block if it has one. /// </summary> /// <returns>The <see cref="TileEntity"/> attached to this block, or null if the block type does not require a Tile Entity.</returns> public TileEntity GetTileEntity() { return(_collection.GetTileEntity(_index)); }