Record Class ServerStatus

java.lang.Object
java.lang.Record
net.minecraft.network.protocol.status.ServerStatus

public record ServerStatus(Component description, Optional<ServerStatus.Players> players, Optional<ServerStatus.Version> version, Optional<ServerStatus.Favicon> favicon, boolean enforcesSecureChat, Optional<ServerStatusPing> forgeData) extends Record
  • Field Details

    • description

      private final Component description
      The field for the description record component.
    • players

      private final Optional<ServerStatus.Players> players
      The field for the players record component.
    • version

      private final Optional<ServerStatus.Version> version
      The field for the version record component.
    • favicon

      private final Optional<ServerStatus.Favicon> favicon
      The field for the favicon record component.
    • enforcesSecureChat

      private final boolean enforcesSecureChat
      The field for the enforcesSecureChat record component.
    • forgeData

      private final Optional<ServerStatusPing> forgeData
      The field for the forgeData record component.
    • CODEC

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

    • ServerStatus

      public ServerStatus(Component description, Optional<ServerStatus.Players> players, Optional<ServerStatus.Version> version, Optional<ServerStatus.Favicon> favicon, boolean enforcesSecureChat, Optional<ServerStatusPing> forgeData)
      Creates an instance of a ServerStatus record class.
      Parameters:
      description - the value for the description record component
      players - the value for the players record component
      version - the value for the version record component
      favicon - the value for the favicon record component
      enforcesSecureChat - the value for the enforcesSecureChat record component
      forgeData - the value for the forgeData 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.
    • description

      public Component description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • players

      public Optional<ServerStatus.Players> players()
      Returns the value of the players record component.
      Returns:
      the value of the players record component
    • version

      public Optional<ServerStatus.Version> version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • favicon

      public Optional<ServerStatus.Favicon> favicon()
      Returns the value of the favicon record component.
      Returns:
      the value of the favicon record component
    • enforcesSecureChat

      public boolean enforcesSecureChat()
      Returns the value of the enforcesSecureChat record component.
      Returns:
      the value of the enforcesSecureChat record component
    • forgeData

      public Optional<ServerStatusPing> forgeData()
      Returns the value of the forgeData record component.
      Returns:
      the value of the forgeData record component