public byte GetBlockIn(long CX, long CZ, Vector3i pos)
{
pos = new Vector3i(pos.Y, pos.X, pos.Z);
/*
if (
!Check(pos.X, -1, ChunkX) ||
!Check(pos.Y, -1, ChunkZ) ||
!Check(pos.Z, -1, ChunkY))
{
//if(_DEBUG) Console.WriteLine("<{0},{1},{2}> out of bounds", x, y, z);
return 0x00;
}
*/
Vector2i ci = GetChunkHandle((int)CX, (int)CZ);
int i = GetBlockIndex((int)pos.X, (int)pos.Y, (int)pos.Z);
//try
//{
if (mChunks.ContainsKey(ci))
{
if (mChunks[ci] == null) return 0x00;
return mChunks[ci].Blocks[(int)pos.X, (int)pos.Y, (int)pos.Z];
}
//}
//catch (Exception)
//{
// return 0x00;
//}
Chunk c = _LoadChunk((int)CX, (int)CZ);
if (!mChunks.ContainsKey(ci))
mChunks.Add(ci, c);
try
{
return c.Blocks[(int)pos.X, (int)pos.Y, (int)pos.Z];
}
catch (Exception)
{
return 0x00;
}
}