Skip to content

Commit 96f0ee1

Browse files
authored
Add check for max growth age special case (#1652)
1 parent 65b1288 commit 96f0ee1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/GrowingPlantHeadBlock.java.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@Override
66
public BlockState getStateForPlacement(RandomSource random) {
77
- return this.defaultBlockState().setValue(AGE, Integer.valueOf(random.nextInt(25)));
8-
+ return this.defaultBlockState().setValue(AGE, Integer.valueOf(random.nextInt(getMaxGrowthAge()))); // Purpur - kelp, cave, weeping, and twisting configurable max growth age
8+
+ return this.defaultBlockState().setValue(AGE, Integer.valueOf(getMaxGrowthAge() == 0 ? 0 : random.nextInt(getMaxGrowthAge()))); // Purpur - kelp, cave, weeping, and twisting configurable max growth age
99
}
1010

1111
@Override

0 commit comments

Comments
 (0)