Record Class MinMaxBounds.Doubles

java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.MinMaxBounds.Doubles
All Implemented Interfaces:
MinMaxBounds<Double>
Enclosing interface:
MinMaxBounds<T extends Number>

public static record MinMaxBounds.Doubles(Optional<Double> min, Optional<Double> max, Optional<Double> minSq, Optional<Double> maxSq) extends Record implements MinMaxBounds<Double>
  • Field Details

  • Constructor Details

    • Doubles

      private Doubles(Optional<Double> p_298243_, Optional<Double> p_299159_)
    • Doubles

      public Doubles(Optional<Double> min, Optional<Double> max, Optional<Double> minSq, Optional<Double> maxSq)
      Creates an instance of a Doubles record class.
      Parameters:
      min - the value for the min record component
      max - the value for the max record component
      minSq - the value for the minSq record component
      maxSq - the value for the maxSq record component
  • Method Details

    • create

      private static MinMaxBounds.Doubles create(com.mojang.brigadier.StringReader p_154796_, Optional<Double> p_298478_, Optional<Double> p_298476_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • squareOpt

      private static Optional<Double> squareOpt(Optional<Double> p_298534_)
    • exactly

      public static MinMaxBounds.Doubles exactly(double p_154787_)
    • between

      public static MinMaxBounds.Doubles between(double p_154789_, double p_154790_)
    • atLeast

      public static MinMaxBounds.Doubles atLeast(double p_154805_)
    • atMost

      public static MinMaxBounds.Doubles atMost(double p_154809_)
    • matches

      public boolean matches(double p_154811_)
    • matchesSqr

      public boolean matchesSqr(double p_154813_)
    • fromReader

      public static MinMaxBounds.Doubles fromReader(com.mojang.brigadier.StringReader p_154794_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • fromReader

      public static MinMaxBounds.Doubles fromReader(com.mojang.brigadier.StringReader p_154800_, Function<Double,Double> p_154801_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • min

      public Optional<Double> min()
      Returns the value of the min record component.
      Specified by:
      min in interface MinMaxBounds<Double>
      Returns:
      the value of the min record component
    • max

      public Optional<Double> max()
      Returns the value of the max record component.
      Specified by:
      max in interface MinMaxBounds<Double>
      Returns:
      the value of the max record component
    • minSq

      public Optional<Double> minSq()
      Returns the value of the minSq record component.
      Returns:
      the value of the minSq record component
    • maxSq

      public Optional<Double> maxSq()
      Returns the value of the maxSq record component.
      Returns:
      the value of the maxSq record component