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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
static final record
static final record
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ServerStatus>
private final Component
The field for thedescription
record component.private final boolean
The field for theenforcesSecureChat
record component.private final Optional<ServerStatus.Favicon>
The field for thefavicon
record component.private final Optional<ServerStatusPing>
The field for theforgeData
record component.private final Optional<ServerStatus.Players>
The field for theplayers
record component.private final Optional<ServerStatus.Version>
The field for theversion
record component. -
Constructor Summary
ConstructorDescriptionServerStatus
(Component description, Optional<ServerStatus.Players> players, Optional<ServerStatus.Version> version, Optional<ServerStatus.Favicon> favicon, boolean enforcesSecureChat, Optional<ServerStatusPing> forgeData) Creates an instance of aServerStatus
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescription
record component.boolean
Returns the value of theenforcesSecureChat
record component.final boolean
Indicates whether some other object is "equal to" this one.favicon()
Returns the value of thefavicon
record component.Returns the value of theforgeData
record component.final int
hashCode()
Returns a hash code value for this object.players()
Returns the value of theplayers
record component.final String
toString()
Returns a string representation of this record class.version()
Returns the value of theversion
record component.
-
Field Details
-
description
The field for thedescription
record component. -
players
The field for theplayers
record component. -
version
The field for theversion
record component. -
favicon
The field for thefavicon
record component. -
enforcesSecureChat
private final boolean enforcesSecureChatThe field for theenforcesSecureChat
record component. -
forgeData
The field for theforgeData
record component. -
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 aServerStatus
record class.- Parameters:
description
- the value for thedescription
record componentplayers
- the value for theplayers
record componentversion
- the value for theversion
record componentfavicon
- the value for thefavicon
record componentenforcesSecureChat
- the value for theenforcesSecureChat
record componentforgeData
- the value for theforgeData
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
description
Returns the value of thedescription
record component.- Returns:
- the value of the
description
record component
-
players
Returns the value of theplayers
record component.- Returns:
- the value of the
players
record component
-
version
Returns the value of theversion
record component.- Returns:
- the value of the
version
record component
-
favicon
Returns the value of thefavicon
record component.- Returns:
- the value of the
favicon
record component
-
enforcesSecureChat
public boolean enforcesSecureChat()Returns the value of theenforcesSecureChat
record component.- Returns:
- the value of the
enforcesSecureChat
record component
-
forgeData
Returns the value of theforgeData
record component.- Returns:
- the value of the
forgeData
record component
-