Package net.minecraft.world.scores
Record Class ScoreboardSaveData.Packed
java.lang.Object
java.lang.Record
net.minecraft.world.scores.ScoreboardSaveData.Packed
- Enclosing class:
ScoreboardSaveData
public static record ScoreboardSaveData.Packed(List<Objective.Packed> objectives, List<Scoreboard.PackedScore> scores, Map<DisplaySlot,String> displaySlots, List<PlayerTeam.Packed> teams)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<ScoreboardSaveData.Packed> private final Map
<DisplaySlot, String> The field for thedisplaySlots
record component.private final List
<Objective.Packed> The field for theobjectives
record component.private final List
<Scoreboard.PackedScore> The field for thescores
record component.private final List
<PlayerTeam.Packed> The field for theteams
record component. -
Constructor Summary
ConstructorsConstructorDescriptionPacked
(List<Objective.Packed> objectives, List<Scoreboard.PackedScore> scores, Map<DisplaySlot, String> displaySlots, List<PlayerTeam.Packed> teams) Creates an instance of aPacked
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedisplaySlots
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theobjectives
record component.scores()
Returns the value of thescores
record component.teams()
Returns the value of theteams
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
objectives
The field for theobjectives
record component. -
scores
The field for thescores
record component. -
displaySlots
The field for thedisplaySlots
record component. -
teams
The field for theteams
record component. -
CODEC
-
-
Constructor Details
-
Packed
public Packed(List<Objective.Packed> objectives, List<Scoreboard.PackedScore> scores, Map<DisplaySlot, String> displaySlots, List<PlayerTeam.Packed> teams) Creates an instance of aPacked
record class.- Parameters:
objectives
- the value for theobjectives
record componentscores
- the value for thescores
record componentdisplaySlots
- the value for thedisplaySlots
record componentteams
- the value for theteams
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
objectives
Returns the value of theobjectives
record component.- Returns:
- the value of the
objectives
record component
-
scores
Returns the value of thescores
record component.- Returns:
- the value of the
scores
record component
-
displaySlots
Returns the value of thedisplaySlots
record component.- Returns:
- the value of the
displaySlots
record component
-
teams
Returns the value of theteams
record component.- Returns:
- the value of the
teams
record component
-