mirror of
https://github.com/PaperMC/Folia.git
synced 2025-04-20 19:29:18 +08:00
In 1.18, every chunk section is initialised to a non-null value and recalcBlockCounts() is invoked for each section. However, in a standard world, most sections are empty. In such cases, recalcBlockCounts() would iterate over ever position - even though the block data would all be air. To avoid this, we skip searching the section unless the palette indicates there _could_ be a non-air block state or non-empty fluid state. Chunk loading initially showed that recalcBlockCounts() over sections with a ZeroBitStorage data to to take ~20% of the process, now it takes <1%.