Record Class MinMaxBounds.Ints

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

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

    • min

      private final Optional<Integer> min
      The field for the min record component.
    • max

      private final Optional<Integer> max
      The field for the max record component.
    • minSq

      private final Optional<Long> minSq
      The field for the minSq record component.
    • maxSq

      private final Optional<Long> maxSq
      The field for the maxSq record component.
    • ANY

      public static final MinMaxBounds.Ints ANY
    • CODEC

      public static final com.mojang.serialization.Codec<MinMaxBounds.Ints> CODEC
  • Constructor Details

    • Ints

      private Ints(Optional<Integer> p_299979_, Optional<Integer> p_297344_)
    • Ints

      public Ints(Optional<Integer> min, Optional<Integer> max, Optional<Long> minSq, Optional<Long> maxSq)
      Creates an instance of a Ints 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.Ints create(com.mojang.brigadier.StringReader p_55378_, Optional<Integer> p_297316_, Optional<Integer> p_300359_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • squareOpt

      private static Optional<Long> squareOpt(Optional<Integer> p_300285_)
    • exactly

      public static MinMaxBounds.Ints exactly(int p_55372_)
    • between

      public static MinMaxBounds.Ints between(int p_154815_, int p_154816_)
    • atLeast

      public static MinMaxBounds.Ints atLeast(int p_55387_)
    • atMost

      public static MinMaxBounds.Ints atMost(int p_154820_)
    • matches

      public boolean matches(int p_55391_)
    • matchesSqr

      public boolean matchesSqr(long p_154818_)
    • fromReader

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

      public static MinMaxBounds.Ints fromReader(com.mojang.brigadier.StringReader p_55382_, Function<Integer,Integer> p_55383_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • min

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

      public Optional<Integer> max()
      Returns the value of the max record component.
      Specified by:
      max in interface MinMaxBounds<Integer>
      Returns:
      the value of the max record component
    • 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.
    • minSq

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

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