From c39d525332f1facf5ea97ab551ff1b5794cc848c Mon Sep 17 00:00:00 2001 From: Bixilon Date: Tue, 22 Nov 2022 17:24:34 +0100 Subject: [PATCH] fix chunk reading --- .../registries/versions/PixLyzerLoadingTest.kt | 15 +-------------- .../de/bixilon/minosoft/util/chunk/ChunkUtil.kt | 3 ++- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/integration-test/kotlin/de/bixilon/minosoft/data/registries/versions/PixLyzerLoadingTest.kt b/src/integration-test/kotlin/de/bixilon/minosoft/data/registries/versions/PixLyzerLoadingTest.kt index e0723cf48..0d1cf094e 100644 --- a/src/integration-test/kotlin/de/bixilon/minosoft/data/registries/versions/PixLyzerLoadingTest.kt +++ b/src/integration-test/kotlin/de/bixilon/minosoft/data/registries/versions/PixLyzerLoadingTest.kt @@ -20,7 +20,7 @@ import de.bixilon.minosoft.test.ITUtil import org.testng.Assert import org.testng.annotations.Test -@Test +@Test(groups = ["pixlyzer"], dependsOnGroups = ["version"]) class PixLyzerLoadingTest { private fun Version.test() { @@ -36,67 +36,54 @@ class PixLyzerLoadingTest { ITUtil.loadPixlyzerData("1.14.4").test() } - @Test fun `1_15`() { ITUtil.loadPixlyzerData("1.15").test() } - @Test fun `1_15_1`() { ITUtil.loadPixlyzerData("1.15.1").test() } - @Test fun `1_15_2`() { ITUtil.loadPixlyzerData("1.15.2").test() } - @Test fun `1_16`() { ITUtil.loadPixlyzerData("1.16").test() } - @Test fun `1_16_1`() { ITUtil.loadPixlyzerData("1.16.1").test() } - @Test fun `1_16_2`() { ITUtil.loadPixlyzerData("1.16.2").test() } - @Test fun `1_16_3`() { ITUtil.loadPixlyzerData("1.16.3").test() } - @Test fun `1_16_5`() { ITUtil.loadPixlyzerData("1.16.5").test() } - @Test fun `1_17`() { ITUtil.loadPixlyzerData("1.17").test() } - @Test fun `1_17_1`() { ITUtil.loadPixlyzerData("1.17.1").test() } - @Test fun `1_18_1`() { ITUtil.loadPixlyzerData("1.18.1").test() } - @Test fun `1_18_2`() { ITUtil.loadPixlyzerData("1.18.2").test() } - @Test fun `1_19`() { ITUtil.loadPixlyzerData("1.19").test() } diff --git a/src/main/java/de/bixilon/minosoft/util/chunk/ChunkUtil.kt b/src/main/java/de/bixilon/minosoft/util/chunk/ChunkUtil.kt index 74244099b..1e84aaeb8 100644 --- a/src/main/java/de/bixilon/minosoft/util/chunk/ChunkUtil.kt +++ b/src/main/java/de/bixilon/minosoft/util/chunk/ChunkUtil.kt @@ -162,10 +162,11 @@ object ChunkUtil { var lightReceived = 0 val biomes: Array?> = arrayOfNulls(dimension.sections) - for ((sectionIndex, sectionHeight) in (dimension.minSection until (sectionBitMask?.length() ?: dimension.sections)).withIndex()) { // max sections per chunks in chunk column + for (sectionIndex in (0 until (sectionBitMask?.length() ?: dimension.sections))) { // max sections per chunks in chunk column if (sectionBitMask?.get(sectionIndex) == false) { continue } + val sectionHeight = sectionIndex + dimension.minSection if (buffer.versionId >= V_18W43A) { buffer.readShort() // non-air block count }