diff --git a/CubicChunksAPI/src/main/java/io/github/opencubicchunks/cubicchunks/api/world/IMinMaxHeight.java b/CubicChunksAPI/src/main/java/io/github/opencubicchunks/cubicchunks/api/world/IMinMaxHeight.java index cfb173021..011b8827f 100644 --- a/CubicChunksAPI/src/main/java/io/github/opencubicchunks/cubicchunks/api/world/IMinMaxHeight.java +++ b/CubicChunksAPI/src/main/java/io/github/opencubicchunks/cubicchunks/api/world/IMinMaxHeight.java @@ -32,7 +32,8 @@ @MethodsReturnNonnullByDefault public interface IMinMaxHeight { /** - * Returns Y position of the bottom block in the world + * Returns Y position of the bottom block in the world, + * inclusive * * @return the bottom of the world */ @@ -42,6 +43,7 @@ default int getMinHeight() { /** * Returns Y position of block above the top block in the world, + * exclusive * * @return the top of the world */ diff --git a/src/main/java/io/github/opencubicchunks/cubicchunks/core/asm/mixin/core/common/MixinChunk_Cubes.java b/src/main/java/io/github/opencubicchunks/cubicchunks/core/asm/mixin/core/common/MixinChunk_Cubes.java index e7ffd3d46..0ce064285 100644 --- a/src/main/java/io/github/opencubicchunks/cubicchunks/core/asm/mixin/core/common/MixinChunk_Cubes.java +++ b/src/main/java/io/github/opencubicchunks/cubicchunks/core/asm/mixin/core/common/MixinChunk_Cubes.java @@ -239,7 +239,9 @@ private int modifySectionArrayLength(int sixteen, World worldIn, int x, int z) { } if (!((ICubicWorld) worldIn).isCubicWorld()) { IMinMaxHeight y = (IMinMaxHeight) worldIn; - return Coords.blockToCube(y.getMaxHeight()) - Coords.blockToCube(y.getMinHeight()); + int firstInclusiveY = y.getMinHeight(); + int lastInclusiveY = y.getMaxHeight() - 1; + return Coords.blockToCube(lastInclusiveY) - Coords.blockToCube(firstInclusiveY) + 1; } return sixteen; }