NetherVines .java

net.minecraft.world.level.block.NetherVines (class, 25 lines): members: BONEMEAL_GROW_PROBABILITY_DECREASE_RATE, isValidGrowthState. imports: RandomSource.

net.minecraft.world.level.blockclass25 linescommon647 B

API Surface (2)

boolean isValidGrowthState(final BlockState state)
int getBlocksToGrowWhenBonemealed(final RandomSource random)

Fields & Constants (2)

BONEMEAL_GROW_PROBABILITY_DECREASE_RATE
GROW_PER_TICK_PROBABILITY

Code Graph: Dependencies (2)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

NetherVines.java25 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.block;
2
3
import net.minecraft.util.RandomSource;
4
import net.minecraft.world.level.block.state.BlockState;
5
6
public class NetherVines {
7
	private static final double BONEMEAL_GROW_PROBABILITY_DECREASE_RATE = 0.826;
8
	public static final double GROW_PER_TICK_PROBABILITY = 0.1;
9
10
	public static boolean isValidGrowthState(final BlockState state) {
11
		return state.isAir();
12
	}
13
14
	public static int getBlocksToGrowWhenBonemealed(final RandomSource random) {
15
		double growProbabilty = 1.0;
16
17
		int count;
18
		for (count = 0; random.nextDouble() < growProbabilty; count++) {
19
			growProbabilty *= 0.826;
20
		}
21
22
		return count;
23
	}
24
}
25

Decompiled Minecraft 26.3 source of NetherVines (net/minecraft/world/level/block/NetherVines.java) with Mojang official mappings, stored verbatim on the site.