Record Class RegisteredQuality

java.lang.Object
java.lang.Record
petrolpark.mc.pquality.core.RegisteredQuality
All Implemented Interfaces:
Comparable<IQuality>, IQuality

public record RegisteredQuality(int priority, double multiplier, double bigMultiplier, double reducer, net.minecraft.core.Holder<petrolpark.mc.library.core.flags.Flag> flag) extends Record implements IQuality
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<RegisteredQuality>
     
    protected static final Map<net.minecraft.core.Holder<petrolpark.mc.library.core.flags.Flag>,net.minecraft.core.Holder<RegisteredQuality>>
     
    protected static final SortedSet<net.minecraft.core.Holder<petrolpark.mc.library.core.flags.Flag>>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    RegisteredQuality(int priority, double multiplier, double bigMultiplier, double reducer, net.minecraft.core.Holder<petrolpark.mc.library.core.flags.Flag> flag)
    Creates an instance of a RegisteredQuality record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the value of the bigMultiplier record component.
    double
    bigMultiply(double base)
     
    float
    bigMultiply(float base)
     
    int
    bigMultiply(int base)
     
    org.apache.commons.lang3.math.Fraction
    bigMultiply(org.apache.commons.lang3.math.Fraction base)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.minecraft.core.Holder<petrolpark.mc.library.core.flags.Flag>
    Returns the value of the flag record component.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the multiplier record component.
    double
    multiply(double base)
     
    float
    multiply(float base)
     
    int
    multiply(int base)
     
    org.apache.commons.lang3.math.Fraction
    multiply(org.apache.commons.lang3.math.Fraction base)
     
    int
    Returns the value of the priority record component.
    double
    reduce(double base)
     
    float
    reduce(float base)
     
    int
    reduce(int base)
     
    org.apache.commons.lang3.math.Fraction
    reduce(org.apache.commons.lang3.math.Fraction base)
     
    double
    Returns the value of the reducer record component.
    int
    reduceToZero(int base)
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface petrolpark.mc.pquality.core.IQuality

    compareTo
  • Field Details

    • FLAG_QUALITIES

      protected static final Map<net.minecraft.core.Holder<petrolpark.mc.library.core.flags.Flag>,net.minecraft.core.Holder<RegisteredQuality>> FLAG_QUALITIES
    • ORDERED_FLAGS

      protected static final SortedSet<net.minecraft.core.Holder<petrolpark.mc.library.core.flags.Flag>> ORDERED_FLAGS
    • DIRECT_CODEC

      public static final com.mojang.serialization.Codec<RegisteredQuality> DIRECT_CODEC
  • Constructor Details

    • RegisteredQuality

      public RegisteredQuality(int priority, double multiplier, double bigMultiplier, double reducer, net.minecraft.core.Holder<petrolpark.mc.library.core.flags.Flag> flag)
      Creates an instance of a RegisteredQuality record class.
      Parameters:
      priority - the value for the priority record component
      multiplier - the value for the multiplier record component
      bigMultiplier - the value for the bigMultiplier record component
      reducer - the value for the reducer record component
      flag - the value for the flag record component
  • Method Details

    • multiply

      public double multiply(double base)
      Specified by:
      multiply in interface IQuality
    • bigMultiply

      public double bigMultiply(double base)
      Specified by:
      bigMultiply in interface IQuality
    • reduce

      public double reduce(double base)
      Specified by:
      reduce in interface IQuality
    • multiply

      public int multiply(int base)
      Specified by:
      multiply in interface IQuality
    • bigMultiply

      public int bigMultiply(int base)
      Specified by:
      bigMultiply in interface IQuality
    • reduce

      public int reduce(int base)
      Specified by:
      reduce in interface IQuality
    • reduceToZero

      public int reduceToZero(int base)
      Specified by:
      reduceToZero in interface IQuality
    • multiply

      public float multiply(float base)
      Specified by:
      multiply in interface IQuality
    • bigMultiply

      public float bigMultiply(float base)
      Specified by:
      bigMultiply in interface IQuality
    • reduce

      public float reduce(float base)
      Specified by:
      reduce in interface IQuality
    • multiply

      public org.apache.commons.lang3.math.Fraction multiply(org.apache.commons.lang3.math.Fraction base)
      Specified by:
      multiply in interface IQuality
    • bigMultiply

      public org.apache.commons.lang3.math.Fraction bigMultiply(org.apache.commons.lang3.math.Fraction base)
      Specified by:
      bigMultiply in interface IQuality
    • reduce

      public org.apache.commons.lang3.math.Fraction reduce(org.apache.commons.lang3.math.Fraction base)
      Specified by:
      reduce in interface IQuality
    • 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.
    • priority

      public int priority()
      Returns the value of the priority record component.
      Specified by:
      priority in interface IQuality
      Returns:
      the value of the priority record component
    • multiplier

      public double multiplier()
      Returns the value of the multiplier record component.
      Returns:
      the value of the multiplier record component
    • bigMultiplier

      public double bigMultiplier()
      Returns the value of the bigMultiplier record component.
      Returns:
      the value of the bigMultiplier record component
    • reducer

      public double reducer()
      Returns the value of the reducer record component.
      Returns:
      the value of the reducer record component
    • flag

      public net.minecraft.core.Holder<petrolpark.mc.library.core.flags.Flag> flag()
      Returns the value of the flag record component.
      Returns:
      the value of the flag record component