From ef8e1fa2fb6a0591249bed7330460e6d5b52bf9e Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 9 Jul 2023 01:29:51 +0200 Subject: [PATCH] [Fix] Stalactites could not grow beyong size 7 (#260) --- .../java/org/betterx/bclib/blocks/StalactiteBlock.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/betterx/bclib/blocks/StalactiteBlock.java b/src/main/java/org/betterx/bclib/blocks/StalactiteBlock.java index 9e524f52..782d9ebb 100644 --- a/src/main/java/org/betterx/bclib/blocks/StalactiteBlock.java +++ b/src/main/java/org/betterx/bclib/blocks/StalactiteBlock.java @@ -115,7 +115,10 @@ public class StalactiteBlock extends BaseBlockNotFull implements SimpleWaterlogg int startSize = floor ? 1 : 2; mut.set(pos.getX(), pos.getY() + 1, pos.getZ()); for (int i = 0; i < 8 && isThis(bState); i++) { - world.setBlockAndUpdate(mut, bState.setValue(SIZE, startSize++).setValue(IS_FLOOR, false)); + world.setBlockAndUpdate( + mut, + bState.setValue(SIZE, Math.min(7, startSize + i)).setValue(IS_FLOOR, false) + ); mut.setY(mut.getY() + 1); bState = world.getBlockState(mut); } @@ -124,7 +127,10 @@ public class StalactiteBlock extends BaseBlockNotFull implements SimpleWaterlogg startSize = floor ? 2 : 1; mut.set(pos.getX(), pos.getY() - 1, pos.getZ()); for (int i = 0; i < 8 && isThis(bState); i++) { - world.setBlockAndUpdate(mut, bState.setValue(SIZE, startSize++).setValue(IS_FLOOR, true)); + world.setBlockAndUpdate( + mut, + bState.setValue(SIZE, Math.min(7, startSize + i)).setValue(IS_FLOOR, true) + ); mut.setY(mut.getY() - 1); bState = world.getBlockState(mut); }