public Block GetBlock(int x, int y, int z) { GridPosition chunkPos = CalculateChunkPosition(x, y, z); WorldChunk chunk = GetChunk(chunkPos); if (chunk != null) { GridPosition blockPos = CalculateBlockPosition(x, y, z); return(chunk.GetBlock(blockPos.x, blockPos.y, blockPos.z, true)); } return(new Block { Type = Block.BlockTypes.Air }); }