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.
|
BaseBlock |
applyBlock(BlockVector3 position)
Return a
BaseBlock 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 BaseBlock applyBlock(BlockVector3 position)
Pattern
BaseBlock
for the given position.position
- the position