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
-
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 boolean
The field for theisModded
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) Deprecated.ServerStatus
(Component description, Optional<ServerStatus.Players> players, Optional<ServerStatus.Version> version, Optional<ServerStatus.Favicon> favicon, boolean enforcesSecureChat, boolean isModded) 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.final int
hashCode()
Returns a hash code value for this object.boolean
isModded()
Returns the value of theisModded
record component.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. -
isModded
private final boolean isModdedThe field for theisModded
record component. -
CODEC
-
-
Constructor Details
-
ServerStatus
@Deprecated public ServerStatus(Component description, Optional<ServerStatus.Players> players, Optional<ServerStatus.Version> version, Optional<ServerStatus.Favicon> favicon, boolean enforcesSecureChat) Deprecated. -
ServerStatus
public ServerStatus(Component description, Optional<ServerStatus.Players> players, Optional<ServerStatus.Version> version, Optional<ServerStatus.Favicon> favicon, boolean enforcesSecureChat, boolean isModded) 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 componentisModded
- the value for theisModded
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
-
isModded
public boolean isModded()Returns the value of theisModded
record component.- Returns:
- the value of the
isModded
record component
-
ServerStatus(Component, Optional, Optional, Optional, boolean, boolean)