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, boolean isModded) 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.
    • isModded

      private final boolean isModded
      The field for the isModded record component.
    • CODEC

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

  • 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
    • isModded

      public boolean isModded()
      Returns the value of the isModded record component.
      Returns:
      the value of the isModded record component