Record Class WrappedMinMaxBounds

java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.WrappedMinMaxBounds

public record WrappedMinMaxBounds(@Nullable Float min, @Nullable Float max) extends Record
  • Field Details

    • min

      @Nullable private final Float min
      The field for the min record component.
    • max

      @Nullable private final Float max
      The field for the max record component.
    • ANY

      public static final WrappedMinMaxBounds ANY
    • ERROR_INTS_ONLY

      public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_INTS_ONLY
  • Constructor Details

    • WrappedMinMaxBounds

      public WrappedMinMaxBounds(@Nullable Float min, @Nullable Float max)
      Creates an instance of a WrappedMinMaxBounds record class.
      Parameters:
      min - the value for the min record component
      max - the value for the max record component
  • Method Details

    • exactly

      public static WrappedMinMaxBounds exactly(float p_164403_)
    • between

      public static WrappedMinMaxBounds between(float p_164405_, float p_164406_)
    • atLeast

      public static WrappedMinMaxBounds atLeast(float p_164415_)
    • atMost

      public static WrappedMinMaxBounds atMost(float p_164418_)
    • matches

      public boolean matches(float p_164420_)
    • matchesSqr

      public boolean matchesSqr(double p_164401_)
    • serializeToJson

      public com.google.gson.JsonElement serializeToJson()
    • fromJson

      public static WrappedMinMaxBounds fromJson(@Nullable com.google.gson.JsonElement p_164408_)
    • fromReader

      public static WrappedMinMaxBounds fromReader(com.mojang.brigadier.StringReader p_164410_, boolean p_164411_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • fromReader

      public static WrappedMinMaxBounds fromReader(com.mojang.brigadier.StringReader p_75360_, boolean p_75361_, Function<Float,Float> p_75362_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • readNumber

      @Nullable private static Float readNumber(com.mojang.brigadier.StringReader p_75368_, boolean p_75369_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • isAllowedNumber

      private static boolean isAllowedNumber(com.mojang.brigadier.StringReader p_75371_, boolean p_75372_)
    • optionallyFormat

      @Nullable private static Float optionallyFormat(@Nullable Float p_75364_, Function<Float,Float> p_75365_)
    • 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

      @Nullable public Float min()
      Returns the value of the min record component.
      Returns:
      the value of the min record component
    • max

      @Nullable public Float max()
      Returns the value of the max record component.
      Returns:
      the value of the max record component