Record Class FishProperties.SizeAndWeight
java.lang.Object
java.lang.Record
com.wdiscute.starcatcher.registry.FishProperties.SizeAndWeight
- Enclosing class:
FishProperties
public static record FishProperties.SizeAndWeight(float sizeAverage, float sizeDeviation, float weightAverage, float weightDeviation, float goldenChance)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<FishProperties.SizeAndWeight> static final FishProperties.SizeAndWeightstatic final FishProperties.SizeAndWeightstatic final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, FishProperties.SizeAndWeight> -
Constructor Summary
ConstructorsConstructorDescriptionSizeAndWeight(float sizeAverage, float sizeDeviation, float weightAverage, float weightDeviation) SizeAndWeight(float sizeAverage, float sizeDeviation, float weightAverage, float weightDeviation, float goldenChance) Creates an instance of aSizeAndWeightrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static intgetRandomSize(FishProperties fp, float percentile) static intgetRandomWeight(FishProperties fp, float percentile) floatReturns the value of thegoldenChancerecord component.final inthashCode()Returns a hash code value for this object.floatReturns the value of thesizeAveragerecord component.floatReturns the value of thesizeDeviationrecord component.final StringtoString()Returns a string representation of this record class.floatReturns the value of theweightAveragerecord component.floatReturns the value of theweightDeviationrecord component.
-
Field Details
-
DEFAULT
-
NONE
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,FishProperties.SizeAndWeight> STREAM_CODEC
-
-
Constructor Details
-
SizeAndWeight
public SizeAndWeight(float sizeAverage, float sizeDeviation, float weightAverage, float weightDeviation) -
SizeAndWeight
public SizeAndWeight(float sizeAverage, float sizeDeviation, float weightAverage, float weightDeviation, float goldenChance) Creates an instance of aSizeAndWeightrecord class.- Parameters:
sizeAverage- the value for thesizeAveragerecord componentsizeDeviation- the value for thesizeDeviationrecord componentweightAverage- the value for theweightAveragerecord componentweightDeviation- the value for theweightDeviationrecord componentgoldenChance- the value for thegoldenChancerecord component
-
-
Method Details
-
getRandomSize
-
getRandomWeight
-
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. All components in this record class are compared with '=='. -
sizeAverage
public float sizeAverage()Returns the value of thesizeAveragerecord component.- Returns:
- the value of the
sizeAveragerecord component
-
sizeDeviation
public float sizeDeviation()Returns the value of thesizeDeviationrecord component.- Returns:
- the value of the
sizeDeviationrecord component
-
weightAverage
public float weightAverage()Returns the value of theweightAveragerecord component.- Returns:
- the value of the
weightAveragerecord component
-
weightDeviation
public float weightDeviation()Returns the value of theweightDeviationrecord component.- Returns:
- the value of the
weightDeviationrecord component
-
goldenChance
public float goldenChance()Returns the value of thegoldenChancerecord component.- Returns:
- the value of the
goldenChancerecord component
-