readd cactus config
This commit is contained in:
@@ -1,5 +1,26 @@
|
||||
--- a/net/minecraft/world/level/block/CactusBlock.java
|
||||
+++ b/net/minecraft/world/level/block/CactusBlock.java
|
||||
@@ -56,14 +_,17 @@
|
||||
i++;
|
||||
}
|
||||
|
||||
- if (i < 3) {
|
||||
+ if (i < level.paperConfig().maxGrowthHeight.cactus) { // Paper - Configurable cactus/bamboo/reed growth height
|
||||
int ageValue = state.getValue(AGE);
|
||||
- if (ageValue == 15) {
|
||||
+
|
||||
+ int modifier = level.spigotConfig.cactusModifier; // Spigot - SPIGOT-7159: Better modifier resolution
|
||||
+ if (ageValue >= 15 || (modifier != 100 && random.nextFloat() < (modifier / (100.0f * 16)))) { // Spigot - SPIGOT-7159: Better modifier
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(level, blockPos, this.defaultBlockState()); // CraftBukkit
|
||||
level.setBlockAndUpdate(blockPos, this.defaultBlockState());
|
||||
BlockState blockState = state.setValue(AGE, Integer.valueOf(0));
|
||||
level.setBlock(pos, blockState, 4);
|
||||
level.neighborChanged(blockState, blockPos, this, null, false);
|
||||
- } else {
|
||||
+ } else if (modifier == 100 || random.nextFloat() < (modifier / (100.0f * 16))) { // Spigot - SPIGOT-7159: Better modifier resolution
|
||||
level.setBlock(pos, state.setValue(AGE, Integer.valueOf(ageValue + 1)), 4);
|
||||
}
|
||||
}
|
||||
@@ -113,7 +_,8 @@
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user