BiomeColorCache throwing exceptions and preventing certain Biomes from rendering
Stelk opened this issue ยท 0 comments
Version information
mc1.18-0.4.0-alpha5
Expected Behavior
World renders correctly when using Lithos Resource Pack (Lithos+v1.57+for+1.18x)
Actual Behavior
Large chuncks of terrain are transparent and do not render
Reproduction Steps
- Install sodium
- Install Lithos
- Launch new world
- Observe missing terrain
Java version
Java 17
CPU
Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz 2.60 GHz
GPU
Nvidia RTX2080
Additional information
No other Mods
I can work around the issue by doubling the array sizes so the index does not go out of bounds
BiomeColorCache.java lines 47 and 48 to double the array sizes
this.cache = new int[this.dim * this.dim * this.dim * 2];
this.blendedColors = new int[BLENDED_COLORS_DIM * BLENDED_COLORS_DIM * BLENDED_COLORS_DIM * 2];
Works fine after this change. My guess is that the BiomeColorCache is not accounting for the negative y levels introduced in 1.18
Original Error
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: java.lang.ArrayIndexOutOfBoundsException: Index 8129 out of bounds for length 8000
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: at me.jellysquid.mods.sodium.client.world.biome.BiomeColorCache.getBlendedColor(BiomeColorCache.java:60)
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: at me.jellysquid.mods.sodium.client.world.WorldSlice.method_23752(WorldSlice.java:270)
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: at net.minecraft.class_1163.method_4965(class_1163.java:14)
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: at net.minecraft.class_1163.method_4962(class_1163.java:18)
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: at net.minecraft.class_324.method_1693(class_324.java:48)
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: at me.jellysquid.mods.sodium.client.model.quad.blender.SmoothBiomeColorBlender.getBlockColor(SmoothBiomeColorBlender.java:47)
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: at me.jellysquid.mods.sodium.client.model.quad.blender.SmoothBiomeColorBlender.getInterpolatedVertexColor(SmoothBiomeColorBlender.java:71)
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: at me.jellysquid.mods.sodium.client.model.quad.blender.SmoothBiomeColorBlender.getColors(SmoothBiomeColorBlender.java:27)
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: at me.jellysquid.mods.sodium.client.render.pipeline.BlockRenderer.renderQuad(BlockRenderer.java:127)
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: at me.jellysquid.mods.sodium.client.render.pipeline.BlockRenderer.renderQuadList(BlockRenderer.java:113)
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: at me.jellysquid.mods.sodium.client.render.pipeline.BlockRenderer.renderModel(BlockRenderer.java:84)
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: at me.jellysquid.mods.sodium.client.render.chunk.tasks.ChunkRenderRebuildTask.performBuild(ChunkRenderRebuildTask.java:99)
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: at me.jellysquid.mods.sodium.client.render.chunk.compile.ChunkBuilder.processJob(ChunkBuilder.java:254)
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: at me.jellysquid.mods.sodium.client.render.chunk.compile.ChunkBuilder$WorkerRunnable.run(ChunkBuilder.java:294)
[05:20:31] [Chunk Render Task Executor #2/INFO]: [STDERR]: at java.base/java.lang.Thread.run(Thread.java:833)