Skip to main content

steel_core/behavior/blocks/vegetation/
nether_vines.rs

1use rand::{Rng, RngExt};
2
3/// Vanilla `getBlocksToGrowWhenBonemealed()`
4pub(crate) fn get_blocks_to_grow_when_bonemealed(rng: &mut dyn Rng) -> i32 {
5    let mut grow_probability = 1.0;
6
7    let mut count = 0;
8
9    while rng.random::<f64>() < grow_probability {
10        grow_probability *= 0.826;
11        count += 1;
12    }
13    count
14}