From 338b6d8bd8e11e5bdbee8ff0ee65a91abd4ed8ab Mon Sep 17 00:00:00 2001 From: hohserg1 Date: Thu, 11 Jan 2024 08:40:33 +0300 Subject: [PATCH 1/2] Fix wrong calculation of required amount of ExtendedBlockStorage's --- .../core/asm/mixin/core/common/MixinChunk_Cubes.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } From 9161aa7a2e8264c43de519169348aca684e1550d Mon Sep 17 00:00:00 2001 From: hohserg1 Date: Thu, 11 Jan 2024 08:41:43 +0300 Subject: [PATCH 2/2] Added explcit meaning to javadoc of IMinMaxHeight --- .../opencubicchunks/cubicchunks/api/world/IMinMaxHeight.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 */