public class RandomPattern extends AbstractPattern
Constructor and Description |
---|
RandomPattern() |
Modifier and Type | Method and Description |
---|---|
void |
add(Pattern pattern,
double chance)
Add a pattern to the weight list of patterns.
|
BlockStateHolder |
apply(BlockVector3 position)
Return a
BlockStateHolder for the given position. |
public void add(Pattern pattern, double chance)
The probability for the pattern added is chance / max where max is the sum of the probabilities of all added patterns.
pattern
- the patternchance
- the chance, which can be any positive numberpublic BlockStateHolder apply(BlockVector3 position)
Pattern
BlockStateHolder
for the given position.position
- the position