Record Class TrapezoidInt
java.lang.Object
java.lang.Record
net.minecraft.util.valueproviders.TrapezoidInt
- All Implemented Interfaces:
IntProvider
public record TrapezoidInt(int minInclusive, int maxInclusive, int plateau)
extends Record
implements IntProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MapCodec<TrapezoidInt> private final intThe field for themaxInclusiverecord component.private final intThe field for theminInclusiverecord component.private final intThe field for theplateaurecord component. -
Constructor Summary
ConstructorsConstructorDescriptionTrapezoidInt(int minInclusive, int maxInclusive, int plateau) Creates an instance of aTrapezoidIntrecord 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.intReturns the value of themaxInclusiverecord component.intReturns the value of theminInclusiverecord component.static TrapezoidIntof(int min, int max, int plateau) intplateau()Returns the value of theplateaurecord component.intsample(RandomSource random) toString()Returns a string representation of this record class.static IntProvidertriangle(int range)
-
Field Details
-
minInclusive
private final int minInclusiveThe field for theminInclusiverecord component. -
maxInclusive
private final int maxInclusiveThe field for themaxInclusiverecord component. -
plateau
private final int plateauThe field for theplateaurecord component. -
MAP_CODEC
-
-
Constructor Details
-
TrapezoidInt
public TrapezoidInt(int minInclusive, int maxInclusive, int plateau) Creates an instance of aTrapezoidIntrecord class.- Parameters:
minInclusive- the value for theminInclusiverecord componentmaxInclusive- the value for themaxInclusiverecord componentplateau- the value for theplateaurecord component
-
-
Method Details
-
of
-
triangle
-
sample
- Specified by:
samplein interfaceIntProvider
-
codec
- Specified by:
codecin interfaceIntProvider
-
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. -
minInclusive
public int minInclusive()Returns the value of theminInclusiverecord component.- Specified by:
minInclusivein interfaceIntProvider- Returns:
- the value of the
minInclusiverecord component
-
maxInclusive
public int maxInclusive()Returns the value of themaxInclusiverecord component.- Specified by:
maxInclusivein interfaceIntProvider- Returns:
- the value of the
maxInclusiverecord component
-
plateau
public int plateau()Returns the value of theplateaurecord component.- Returns:
- the value of the
plateaurecord component
-