Record Class Score.Packed
java.lang.Object
java.lang.Record
net.minecraft.world.scores.Score.Packed
- Enclosing class:
Score
public static record Score.Packed(int value, boolean locked, Optional<Component> display, Optional<NumberFormat> numberFormat)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thedisplayrecord component.private final booleanThe field for thelockedrecord component.static final com.mojang.serialization.MapCodec<Score.Packed> private final Optional<NumberFormat> The field for thenumberFormatrecord component.private final intThe field for thevaluerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPacked(int value, boolean locked, Optional<Component> display, Optional<NumberFormat> numberFormat) Creates an instance of aPackedrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondisplay()Returns the value of thedisplayrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanlocked()Returns the value of thelockedrecord component.Returns the value of thenumberFormatrecord component.final StringtoString()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. -
locked
private final boolean lockedThe field for thelockedrecord component. -
display
-
numberFormat
The field for thenumberFormatrecord component. -
MAP_CODEC
-
-
Constructor Details
-
Packed
public Packed(int value, boolean locked, Optional<Component> display, Optional<NumberFormat> numberFormat) Creates an instance of aPackedrecord class.- Parameters:
value- the value for thevaluerecord componentlocked- the value for thelockedrecord componentdisplay- the value for thedisplayrecord componentnumberFormat- the value for thenumberFormatrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components 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
-
locked
public boolean locked()Returns the value of thelockedrecord component.- Returns:
- the value of the
lockedrecord component
-
display
-
numberFormat
Returns the value of thenumberFormatrecord component.- Returns:
- the value of the
numberFormatrecord component
-