Class RandomPattern

java.lang.Object
com.sk89q.worldedit.function.pattern.AbstractPattern
com.sk89q.worldedit.function.pattern.RandomPattern
All Implemented Interfaces:
Pattern

public class RandomPattern extends AbstractPattern
Uses a random pattern of a weighted list of patterns.
  • Constructor Details

    • RandomPattern

      public RandomPattern()
  • Method Details

    • add

      public void add(Pattern pattern, double chance)
      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 pattern
      chance - the chance, which can be any positive number
    • applyBlock

      public BaseBlock applyBlock(BlockVector3 position)
      Description copied from interface: Pattern
      Return a BaseBlock for the given position.
      Parameters:
      position - the position
      Returns:
      a block