示例#1
0
    /// <summary>
    /// Returns the block at the specified position, or null if it cannot be found
    /// </summary>
    /// <param name="pos"></param>
    /// <returns></returns>
    public BlockState GetBlock(BlockPos pos)
    {
        lock (_chunks)
        {
            Chunk c = GetChunk(pos.GetChunk());

            if (c == null)
            {
                return(new BlockState(BlockType.VOID_AIR));                 // use void air for unloaded chunks
            }
            else
            {
                return(c.GetBlockAt(pos));
            }
        }
    }