Exemplo n.º 1
0
        /// <inheritdoc/>
        public IChunk GetChunk(int cx, int cz)
        {
            if (!ChunkExists(cx, cz))
            {
                return(null);
            }

            return(AlphaChunk.CreateVerified(GetChunkTree(cx, cz)));
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public ChunkRef CreateChunk(int cx, int cz)
        {
            DeleteChunk(cx, cz);
            AlphaChunk c = AlphaChunk.Create(cx, cz);

            c.Save(GetChunkOutStream(cx, cz));

            ChunkRef cr = ChunkRef.Create(this, cx, cz);
            ChunkKey k  = new ChunkKey(cx, cz);

            _cache[k] = cr;

            return(cr);
        }
Exemplo n.º 3
0
        public AlphaBlockManager(IChunkManager cm)
            : base(cm)
        {
            IChunk c = AlphaChunk.Create(0, 0);

            chunkXDim  = c.Blocks.XDim;
            chunkYDim  = c.Blocks.YDim;
            chunkZDim  = c.Blocks.ZDim;
            chunkXMask = chunkXDim - 1;
            chunkYMask = chunkYDim - 1;
            chunkZMask = chunkZDim - 1;
            chunkXLog  = Log2(chunkXDim);
            chunkYLog  = Log2(chunkYDim);
            chunkZLog  = Log2(chunkZDim);
        }
Exemplo n.º 4
0
        /// <inheritdoc/>
        public ChunkRef CreateChunk(int cx, int cz)
        {
            DeleteChunk(cx, cz);
            AlphaChunk chunk = AlphaChunk.Create(cx, cz);

            using (Stream chunkOutStream = GetChunkOutStream(cx, cz))
            {
                chunk.Save(chunkOutStream);
            }

            ChunkRef cr = ChunkRef.Create(this, cx, cz);
            ChunkKey k  = new ChunkKey(cx, cz);

            _cache[k] = cr;

            return(cr);
        }
Exemplo n.º 5
0
 protected override IChunk CreateChunkVerifiedCore(NbtTree tree)
 {
     return(AlphaChunk.CreateVerified(tree));
 }
Exemplo n.º 6
0
 protected override IChunk CreateChunkCore(int cx, int cz)
 {
     return(AlphaChunk.Create(cx, cz));
 }