Class RandomPattern
java.lang.Object
com.sk89q.worldedit.function.pattern.AbstractPattern
com.sk89q.worldedit.function.pattern.RandomPattern
- All Implemented Interfaces:
Pattern
Uses a random pattern of a weighted list of patterns.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a pattern to the weight list of patterns.applyBlock
(BlockVector3 position) Return aBaseBlock
for the given position.
-
Constructor Details
-
RandomPattern
public RandomPattern()
-
-
Method Details
-
add
Add a pattern to the weight list of patterns.The probability for the pattern added is chance / max where max is the sum of the probabilities of all added patterns.
- Parameters:
pattern
- the patternchance
- the chance, which can be any positive number
-
applyBlock
Description copied from interface:Pattern
Return aBaseBlock
for the given position.- Parameters:
position
- the position- Returns:
- a block
-