Beispiel #1
0
        public virtual void Generate(ChunkGenerateEvent e)
        {
            var pos   = e.pos;
            var chunk = e.chunk;
            var min   = chunk.position.min;
            var max   = chunk.position.max;

            for (int z = min.z; z <= max.z; z++)
            {
                for (int x = min.x; x <= max.x; x++)
                {
                    for (int y = min.y; y <= max.y; y++)
                    {
                        pos.Set(x, y, z);
                        var blockId = CalcBlockId(pos);
                        chunk.SetBlockData(pos, blockId.GetBlockData());
                    }
                }
            }
        }
Beispiel #2
0
        public override void Generate(ChunkGenerateEvent e)
        {
            var pos   = e.pos;
            var chunk = e.chunk;

            pos.Set(chunk.position);
            if ((pos.x >> 4) == 0 && (pos.y >> 4) == 0 && (pos.z >> 4) == 0)
            {
                var blockId = BlockType.Stone;
                pos.Set(e.chunk.position);
                pos.Add(1, 1, 1);
                chunk.SetBlockData(pos, blockId.GetBlockData());
                pos.Set(e.chunk.position);
                pos.Add(2, 1, 1);
                chunk.SetBlockData(pos, blockId.GetBlockData());
                pos.Set(e.chunk.position);
                pos.Add(2, 2, 1);
                chunk.SetBlockData(pos, blockId.GetBlockData());
                pos.Set(e.chunk.position);
                pos.Add(1, 2, 1);
                chunk.SetBlockData(pos, blockId.GetBlockData());
            }
        }