Record Class ConstantInt
java.lang.Object
java.lang.Record
net.minecraft.util.valueproviders.ConstantInt
- All Implemented Interfaces:
IntProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MapCodec<ConstantInt> private final intThe field for thevaluerecord component.static final ConstantInt -
Constructor Summary
Constructors -
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.intintstatic ConstantIntof(int value) intsample(RandomSource random) toString()Returns a string representation of this record class.intvalue()Returns the value of thevaluerecord component.
-
Field Details
-
value
private final int valueThe field for thevaluerecord component. -
ZERO
-
MAP_CODEC
-
-
Constructor Details
-
ConstantInt
public ConstantInt(int value) Creates an instance of aConstantIntrecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
of
-
sample
- Specified by:
samplein interfaceIntProvider
-
minInclusive
public int minInclusive()- Specified by:
minInclusivein interfaceIntProvider
-
maxInclusive
public int maxInclusive()- Specified by:
maxInclusivein 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. -
value
public int value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-