Record Class PlayerTeam.Packed

java.lang.Object
java.lang.Record
net.minecraft.world.scores.PlayerTeam.Packed
Enclosing class:
PlayerTeam

public static record PlayerTeam.Packed(String name, Optional<Component> displayName, Optional<ChatFormatting> color, boolean allowFriendlyFire, boolean seeFriendlyInvisibles, Component memberNamePrefix, Component memberNameSuffix, Team.Visibility nameTagVisibility, Team.Visibility deathMessageVisibility, Team.CollisionRule collisionRule, List<String> players) extends Record
  • Field Details

    • name

      private final String name
      The field for the name record component.
    • displayName

      private final Optional<Component> displayName
      The field for the displayName record component.
    • color

      private final Optional<ChatFormatting> color
      The field for the color record component.
    • allowFriendlyFire

      private final boolean allowFriendlyFire
      The field for the allowFriendlyFire record component.
    • seeFriendlyInvisibles

      private final boolean seeFriendlyInvisibles
      The field for the seeFriendlyInvisibles record component.
    • memberNamePrefix

      private final Component memberNamePrefix
      The field for the memberNamePrefix record component.
    • memberNameSuffix

      private final Component memberNameSuffix
      The field for the memberNameSuffix record component.
    • nameTagVisibility

      private final Team.Visibility nameTagVisibility
      The field for the nameTagVisibility record component.
    • deathMessageVisibility

      private final Team.Visibility deathMessageVisibility
      The field for the deathMessageVisibility record component.
    • collisionRule

      private final Team.CollisionRule collisionRule
      The field for the collisionRule record component.
    • players

      private final List<String> players
      The field for the players record component.
    • CODEC

      public static final com.mojang.serialization.Codec<PlayerTeam.Packed> CODEC
  • Constructor Details

    • Packed

      public Packed(String name, Optional<Component> displayName, Optional<ChatFormatting> color, boolean allowFriendlyFire, boolean seeFriendlyInvisibles, Component memberNamePrefix, Component memberNameSuffix, Team.Visibility nameTagVisibility, Team.Visibility deathMessageVisibility, Team.CollisionRule collisionRule, List<String> players)
      Creates an instance of a Packed record class.
      Parameters:
      name - the value for the name record component
      displayName - the value for the displayName record component
      color - the value for the color record component
      allowFriendlyFire - the value for the allowFriendlyFire record component
      seeFriendlyInvisibles - the value for the seeFriendlyInvisibles record component
      memberNamePrefix - the value for the memberNamePrefix record component
      memberNameSuffix - the value for the memberNameSuffix record component
      nameTagVisibility - the value for the nameTagVisibility record component
      deathMessageVisibility - the value for the deathMessageVisibility record component
      collisionRule - the value for the collisionRule record component
      players - the value for the players record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • displayName

      public Optional<Component> displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • color

      public Optional<ChatFormatting> color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • allowFriendlyFire

      public boolean allowFriendlyFire()
      Returns the value of the allowFriendlyFire record component.
      Returns:
      the value of the allowFriendlyFire record component
    • seeFriendlyInvisibles

      public boolean seeFriendlyInvisibles()
      Returns the value of the seeFriendlyInvisibles record component.
      Returns:
      the value of the seeFriendlyInvisibles record component
    • memberNamePrefix

      public Component memberNamePrefix()
      Returns the value of the memberNamePrefix record component.
      Returns:
      the value of the memberNamePrefix record component
    • memberNameSuffix

      public Component memberNameSuffix()
      Returns the value of the memberNameSuffix record component.
      Returns:
      the value of the memberNameSuffix record component
    • nameTagVisibility

      public Team.Visibility nameTagVisibility()
      Returns the value of the nameTagVisibility record component.
      Returns:
      the value of the nameTagVisibility record component
    • deathMessageVisibility

      public Team.Visibility deathMessageVisibility()
      Returns the value of the deathMessageVisibility record component.
      Returns:
      the value of the deathMessageVisibility record component
    • collisionRule

      public Team.CollisionRule collisionRule()
      Returns the value of the collisionRule record component.
      Returns:
      the value of the collisionRule record component
    • players

      public List<String> players()
      Returns the value of the players record component.
      Returns:
      the value of the players record component