Record Class TrapezoidFloat
java.lang.Object
java.lang.Record
net.minecraft.util.valueproviders.TrapezoidFloat
- All Implemented Interfaces:
FloatProvider, SampledFloat
public record TrapezoidFloat(float min, float max, float plateau)
extends Record
implements FloatProvider
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTrapezoidFloat(float min, float max, float plateau) Creates an instance of aTrapezoidFloatrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncodec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatmax()Returns the value of themaxrecord component.floatmin()Returns the value of theminrecord component.static TrapezoidFloatof(float min, float max, float plateau) floatplateau()Returns the value of theplateaurecord component.floatsample(RandomSource random) toString()Returns a string representation of this record class.
-
Field Details
-
min
private final float minThe field for theminrecord component. -
max
private final float maxThe field for themaxrecord component. -
plateau
private final float plateauThe field for theplateaurecord component. -
MAP_CODEC
-
-
Constructor Details
-
TrapezoidFloat
public TrapezoidFloat(float min, float max, float plateau) Creates an instance of aTrapezoidFloatrecord class.- Parameters:
min- the value for theminrecord componentmax- the value for themaxrecord componentplateau- the value for theplateaurecord component
-
-
Method Details
-
of
-
sample
- Specified by:
samplein interfaceSampledFloat
-
codec
- Specified by:
codecin interfaceFloatProvider
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
min
public float min()Returns the value of theminrecord component.- Specified by:
minin interfaceFloatProvider- Returns:
- the value of the
minrecord component
-
max
public float max()Returns the value of themaxrecord component.- Specified by:
maxin interfaceFloatProvider- Returns:
- the value of the
maxrecord component
-
plateau
public float plateau()Returns the value of theplateaurecord component.- Returns:
- the value of the
plateaurecord component
-