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 thedisplaySlotsrecord component.private final List<Objective.Packed> The field for theobjectivesrecord component.private final List<Scoreboard.PackedScore> The field for thescoresrecord component.private final List<PlayerTeam.Packed> The field for theteamsrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPacked(List<Objective.Packed> objectives, List<Scoreboard.PackedScore> scores, Map<DisplaySlot, String> displaySlots, List<PlayerTeam.Packed> teams) Creates an instance of aPackedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedisplaySlotsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theobjectivesrecord component.scores()Returns the value of thescoresrecord component.teams()Returns the value of theteamsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
objectives
The field for theobjectivesrecord component. -
scores
The field for thescoresrecord component. -
displaySlots
The field for thedisplaySlotsrecord component. -
teams
The field for theteamsrecord 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 aPackedrecord class.- Parameters:
objectives- the value for theobjectivesrecord componentscores- the value for thescoresrecord componentdisplaySlots- the value for thedisplaySlotsrecord componentteams- the value for theteamsrecord 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 theobjectivesrecord component.- Returns:
- the value of the
objectivesrecord component
-
scores
Returns the value of thescoresrecord component.- Returns:
- the value of the
scoresrecord component
-
displaySlots
Returns the value of thedisplaySlotsrecord component.- Returns:
- the value of the
displaySlotsrecord component
-
teams
Returns the value of theteamsrecord component.- Returns:
- the value of the
teamsrecord component
-