Interface GrowthComparator

All Known Implementing Classes:
GreaterThanGrowthComparator, LessThanGrowthComparator, RangeGrowthComparator

public interface GrowthComparator
Used for comparing the growth of a Pokemon to the mean and standard deviation of a normal distribution.
This can also be used to generate random values from a normal distribution within the range being detected by this comparator.
Since:
01/10/2024
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<GrowthComparator>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.mojang.serialization.Codec<? extends GrowthComparator>
     
    boolean
    inRange(double mean, double standardDeviation, double size)
    Checks if the growth of the Pokemon is within the configured range for a normal distribution with the given mean and standard deviation.
    double
    random(double mean, double standardDeviation)
    Generates a random value from a normal distribution with the given mean and standard deviation.
  • Field Details

  • Method Details

    • codec

      com.mojang.serialization.Codec<? extends GrowthComparator> codec()
    • inRange

      boolean inRange(double mean, double standardDeviation, double size)
      Checks if the growth of the Pokemon is within the configured range for a normal distribution with the given mean and standard deviation.
      Parameters:
      mean - The mean of the normal distribution
      standardDeviation - The standard deviation of the normal distribution
      size - The size of the Pokemon
      Returns:
      True if the growth is within the range, false otherwise
    • random

      double random(double mean, double standardDeviation)
      Generates a random value from a normal distribution with the given mean and standard deviation.
      Parameters:
      mean - The mean of the normal distribution
      standardDeviation - The standard deviation of the normal distribution
      Returns:
      The random value