Add check for max growth age special case (#1652)

This commit is contained in:
Dreeam
2025-04-12 16:33:24 -04:00
committed by GitHub
parent 65b1288b31
commit 96f0ee1ea3

View File

@@ -5,7 +5,7 @@
@Override @Override
public BlockState getStateForPlacement(RandomSource random) { public BlockState getStateForPlacement(RandomSource random) {
- return this.defaultBlockState().setValue(AGE, Integer.valueOf(random.nextInt(25))); - return this.defaultBlockState().setValue(AGE, Integer.valueOf(random.nextInt(25)));
+ return this.defaultBlockState().setValue(AGE, Integer.valueOf(random.nextInt(getMaxGrowthAge()))); // Purpur - kelp, cave, weeping, and twisting configurable max growth age + return this.defaultBlockState().setValue(AGE, Integer.valueOf(getMaxGrowthAge() == 0 ? 0 : random.nextInt(getMaxGrowthAge()))); // Purpur - kelp, cave, weeping, and twisting configurable max growth age
} }
@Override @Override