Record Class PlayerTabOverlay.ScoreDisplayEntry
java.lang.Object
java.lang.Record
net.minecraft.client.gui.components.PlayerTabOverlay.ScoreDisplayEntry
- Enclosing class:
- PlayerTabOverlay
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Component
The field for theformattedScore
record component.private final Component
The field for thename
record component.private final int
The field for thescore
record component.private final int
The field for thescoreWidth
record component. -
Constructor Summary
ConstructorDescriptionScoreDisplayEntry
(Component name, int score, Component formattedScore, int scoreWidth) Creates an instance of aScoreDisplayEntry
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of theformattedScore
record component.final int
hashCode()
Returns a hash code value for this object.name()
Returns the value of thename
record component.int
score()
Returns the value of thescore
record component.int
Returns the value of thescoreWidth
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
name
The field for thename
record component. -
score
private final int scoreThe field for thescore
record component. -
formattedScore
The field for theformattedScore
record component. -
scoreWidth
private final int scoreWidthThe field for thescoreWidth
record component.
-
-
Constructor Details
-
ScoreDisplayEntry
Creates an instance of aScoreDisplayEntry
record class.- Parameters:
name
- the value for thename
record componentscore
- the value for thescore
record componentformattedScore
- the value for theformattedScore
record componentscoreWidth
- the value for thescoreWidth
record component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
score
public int score()Returns the value of thescore
record component.- Returns:
- the value of the
score
record component
-
formattedScore
Returns the value of theformattedScore
record component.- Returns:
- the value of the
formattedScore
record component
-
scoreWidth
public int scoreWidth()Returns the value of thescoreWidth
record component.- Returns:
- the value of the
scoreWidth
record component
-