From 7f98e4b1eb7a82bed1913fa9955348f09c36c7ec Mon Sep 17 00:00:00 2001 From: James Seibel Date: Fri, 12 Jul 2024 21:31:12 -0500 Subject: [PATCH] Fix potential chunkWrapper null pointer --- .../common/wrappers/chunk/ChunkWrapper.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java index 098d46ec2..05a94f172 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java @@ -250,15 +250,7 @@ public class ChunkWrapper implements IChunkWrapper return section.hasOnlyAir(); #endif } - private int getChunkSectionMinHeight(int index) - { - // convert from an index to a block coordinate - #if MC_VER == MC_1_16_5 || MC_VER == MC_1_17_1 - return this.chunk.getSections()[index].bottomBlockY(); - #else - return this.chunk.getSectionYFromSectionIndex(index) * 16; - #endif - } + private int getChunkSectionMinHeight(int index) { return (index * 16) + this.getMinBuildHeight(); } @Override