From 31fa6a809de8519bbda6931a816c2782341a0c9c Mon Sep 17 00:00:00 2001 From: Moritz Zwerger Date: Sun, 9 Mar 2025 15:24:38 +0100 Subject: [PATCH] occlusion: skip calculating if less then 256 blocks set in chunk When there are less than 256 blocks set, you will always be able to look from one side to another. --- .../minosoft/data/world/container/block/SectionOcclusion.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/bixilon/minosoft/data/world/container/block/SectionOcclusion.kt b/src/main/java/de/bixilon/minosoft/data/world/container/block/SectionOcclusion.kt index 828dc4ba3..eb494740e 100644 --- a/src/main/java/de/bixilon/minosoft/data/world/container/block/SectionOcclusion.kt +++ b/src/main/java/de/bixilon/minosoft/data/world/container/block/SectionOcclusion.kt @@ -46,7 +46,7 @@ class SectionOcclusion( fun recalculate(notify: Boolean) { if (!calculate) return - if (provider.isEmpty) { + if (provider.count < ProtocolDefinition.SECTION_WIDTH_X * ProtocolDefinition.SECTION_WIDTH_Z) { // When there are less than 256 blocks set, you will always be able to look from one side to another clear(notify) return }