All Implemented Interfaces:
AliasedParser
Direct Known Subclasses:
PerlinPatternParser, RidgedMultiFractalPatternParser, SimplexPatternParser, VoronoiPatternParser

public abstract class NoisePatternParser extends RichParser<Pattern>
  • Constructor Details

    • NoisePatternParser

      protected NoisePatternParser(WorldEdit worldEdit, String name, Supplier<NoiseGenerator> generatorSupplier)
      Create a new noise parser with a defined name, e.g. #simplex.
      Parameters:
      worldEdit - the worldedit instance.
      name - the name of this noise.
      generatorSupplier - the supplier to get a NoiseGenerator instance from.
  • Method Details

    • getSuggestions

      protected Stream<String> getSuggestions(String argumentInput, int index)
      Description copied from class: RichParser
      Returns a stream of suggestions for the argument at the given index.
      Specified by:
      getSuggestions in class RichParser<Pattern>
      Parameters:
      argumentInput - the already provided input for the argument at the given index.
      index - the index of the argument to get suggestions for.
      Returns:
      a stream of suggestions matching the given input for the argument at the given index.
    • parseFromInput

      protected Pattern parseFromInput(@Nonnull String[] arguments, ParserContext context)
      Description copied from class: RichParser
      Parses the already split arguments.
      Specified by:
      parseFromInput in class RichParser<Pattern>
      Parameters:
      arguments - the array of arguments that were split (can be empty).
      context - the context of this parsing process.
      Returns:
      the resulting parsed type.
    • parseScale

      protected double parseScale(String argument)
      Modifies the given argument to match the requirements of the noise generator.
      Parameters:
      argument - the parsed scale argument.
      Returns:
      the modified scale.