Record Class WateringSettings

java.lang.Object
java.lang.Record
io.github.pylonmc.pylon.base.content.tools.WateringSettings

public record WateringSettings(int horizontalRange, int verticalRange, double cropChance, double sugarCaneChance, double cactusChance, double saplingChance, double particleChance, @NotNull io.github.pylonmc.pylon.core.util.RandomizedSound sound) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    WateringSettings(int horizontalRange, int verticalRange, double cropChance, double sugarCaneChance, double cactusChance, double saplingChance, double particleChance, @NotNull io.github.pylonmc.pylon.core.util.RandomizedSound sound)
    Creates an instance of a WateringSettings record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the value of the cactusChance record component.
    double
    Returns the value of the cropChance record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    fromConfig(io.github.pylonmc.pylon.core.config.ConfigSection config)
     
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the horizontalRange record component.
    double
    Returns the value of the particleChance record component.
    double
    Returns the value of the saplingChance record component.
    @NotNull io.github.pylonmc.pylon.core.util.RandomizedSound
    Returns the value of the sound record component.
    double
    Returns the value of the sugarCaneChance record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the verticalRange record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • WateringSettings

      public WateringSettings(int horizontalRange, int verticalRange, double cropChance, double sugarCaneChance, double cactusChance, double saplingChance, double particleChance, @NotNull @NotNull io.github.pylonmc.pylon.core.util.RandomizedSound sound)
      Creates an instance of a WateringSettings record class.
      Parameters:
      horizontalRange - the value for the horizontalRange record component
      verticalRange - the value for the verticalRange record component
      cropChance - the value for the cropChance record component
      sugarCaneChance - the value for the sugarCaneChance record component
      cactusChance - the value for the cactusChance record component
      saplingChance - the value for the saplingChance record component
      particleChance - the value for the particleChance record component
      sound - the value for the sound record component
  • Method Details

    • fromConfig

      public static WateringSettings fromConfig(io.github.pylonmc.pylon.core.config.ConfigSection config)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • horizontalRange

      public int horizontalRange()
      Returns the value of the horizontalRange record component.
      Returns:
      the value of the horizontalRange record component
    • verticalRange

      public int verticalRange()
      Returns the value of the verticalRange record component.
      Returns:
      the value of the verticalRange record component
    • cropChance

      public double cropChance()
      Returns the value of the cropChance record component.
      Returns:
      the value of the cropChance record component
    • sugarCaneChance

      public double sugarCaneChance()
      Returns the value of the sugarCaneChance record component.
      Returns:
      the value of the sugarCaneChance record component
    • cactusChance

      public double cactusChance()
      Returns the value of the cactusChance record component.
      Returns:
      the value of the cactusChance record component
    • saplingChance

      public double saplingChance()
      Returns the value of the saplingChance record component.
      Returns:
      the value of the saplingChance record component
    • particleChance

      public double particleChance()
      Returns the value of the particleChance record component.
      Returns:
      the value of the particleChance record component
    • sound

      @NotNull public @NotNull io.github.pylonmc.pylon.core.util.RandomizedSound sound()
      Returns the value of the sound record component.
      Returns:
      the value of the sound record component