Package petrolpark.mc.pquality.core
Record Class RegisteredQuality
java.lang.Object
java.lang.Record
petrolpark.mc.pquality.core.RegisteredQuality
- All Implemented Interfaces:
Comparable<IQuality>,IQuality
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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
ConstructorsConstructorDescriptionRegisteredQuality(int priority, double multiplier, double bigMultiplier, double reducer, net.minecraft.core.Holder<petrolpark.mc.library.core.flags.Flag> flag) Creates an instance of aRegisteredQualityrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thebigMultiplierrecord component.doublebigMultiply(double base) floatbigMultiply(float base) intbigMultiply(int base) org.apache.commons.lang3.math.FractionbigMultiply(org.apache.commons.lang3.math.Fraction base) final booleanIndicates whether some other object is "equal to" this one.net.minecraft.core.Holder<petrolpark.mc.library.core.flags.Flag> flag()Returns the value of theflagrecord component.final inthashCode()Returns a hash code value for this object.doubleReturns the value of themultiplierrecord component.doublemultiply(double base) floatmultiply(float base) intmultiply(int base) org.apache.commons.lang3.math.Fractionmultiply(org.apache.commons.lang3.math.Fraction base) intpriority()Returns the value of thepriorityrecord component.doublereduce(double base) floatreduce(float base) intreduce(int base) org.apache.commons.lang3.math.Fractionreduce(org.apache.commons.lang3.math.Fraction base) doublereducer()Returns the value of thereducerrecord component.intreduceToZero(int base) final StringtoString()Returns a string representation of this record class.
-
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
-
-
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 aRegisteredQualityrecord class.- Parameters:
priority- the value for thepriorityrecord componentmultiplier- the value for themultiplierrecord componentbigMultiplier- the value for thebigMultiplierrecord componentreducer- the value for thereducerrecord componentflag- the value for theflagrecord component
-
-
Method Details
-
multiply
public double multiply(double base) -
bigMultiply
public double bigMultiply(double base) - Specified by:
bigMultiplyin interfaceIQuality
-
reduce
public double reduce(double base) -
multiply
public int multiply(int base) -
bigMultiply
public int bigMultiply(int base) - Specified by:
bigMultiplyin interfaceIQuality
-
reduce
public int reduce(int base) -
reduceToZero
public int reduceToZero(int base) - Specified by:
reduceToZeroin interfaceIQuality
-
multiply
public float multiply(float base) -
bigMultiply
public float bigMultiply(float base) - Specified by:
bigMultiplyin interfaceIQuality
-
reduce
public float reduce(float base) -
multiply
public org.apache.commons.lang3.math.Fraction multiply(org.apache.commons.lang3.math.Fraction base) -
bigMultiply
public org.apache.commons.lang3.math.Fraction bigMultiply(org.apache.commons.lang3.math.Fraction base) - Specified by:
bigMultiplyin interfaceIQuality
-
reduce
public org.apache.commons.lang3.math.Fraction reduce(org.apache.commons.lang3.math.Fraction base) -
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
priority
public int priority()Returns the value of thepriorityrecord component. -
multiplier
public double multiplier()Returns the value of themultiplierrecord component.- Returns:
- the value of the
multiplierrecord component
-
bigMultiplier
public double bigMultiplier()Returns the value of thebigMultiplierrecord component.- Returns:
- the value of the
bigMultiplierrecord component
-
reducer
public double reducer()Returns the value of thereducerrecord component.- Returns:
- the value of the
reducerrecord component
-
flag
public net.minecraft.core.Holder<petrolpark.mc.library.core.flags.Flag> flag()Returns the value of theflagrecord component.- Returns:
- the value of the
flagrecord component
-