Пример #1
0
        public void Recalculate(ChunkColumn chunk)
        {
            ChunkQueues.TryRemove(new ChunkCoordinates(chunk.X, chunk.Z), out _);
            //  var lightSources = chunk.GetLightSources().ToArray();

            foreach (var section in chunk.Sections)
            {
                section?.ResetLight(true, false);
                section?.RemoveInvalidBlocks();
            }

            var chunkpos = new BlockCoordinates(chunk.X << 4, 0, chunk.Z << 4);

            foreach (var lightsource in chunk.GetLightSources().OrderByDescending(x => x.Y))
            {
                Enqueue(chunkpos + lightsource);
            }
            //chunk.GetLightSources()
        }