Ejemplo n.º 1
0
        public Block GetBlock(Pos.BlockPos pos) //retrieves a block from anywhere in the world
        {
            Pos.ChunkPos p         = pos.ToChunk();
            Pos.ChunkPos regionPos = new Pos.BlockPos(p.X, p.Y, p.Z).ToChunk();
            string       region    = regionPos.X.ToString() + "." + regionPos.Y.ToString() + "." + regionPos.Z.ToString();

            if (Regions.ContainsKey(region))
            {
                Chunk c = Regions[region].GetChunk(p.Normalize());
                if (c != null)
                {
                    return(c.GetBlock(pos.Normalize()));
                }
            }
            return(null);
        }
Ejemplo n.º 2
0
 public void SetChunk(Pos.ChunkPos pos, Chunk c)
 {
     pos = pos.Normalize();
     Chunks[pos.X, pos.Y, pos.Z] = c;
 }
Ejemplo n.º 3
0
 public Chunk GetChunk(Pos.ChunkPos pos)
 {
     pos = pos.Normalize();
     return(Chunks[pos.X, pos.Y, pos.Z]);
 }