[Fix] Stalactites could not grow beyong size 7 (#260)

This commit is contained in:
Frank 2023-07-09 01:29:51 +02:00
parent 1448ea8467
commit fc2a68180b

View file

@ -116,7 +116,10 @@ public abstract class StalactiteBlock extends BaseBlockNotFull implements Simple
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);
}
@ -125,7 +128,10 @@ public abstract class StalactiteBlock extends BaseBlockNotFull implements Simple
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);
}