Record Class ClientboundStatusResponsePacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.status.ClientboundStatusResponsePacket
- All Implemented Interfaces:
Packet<ClientStatusPacketListener>
public record ClientboundStatusResponsePacket(ServerStatus status, @Nullable String cachedStatus)
extends Record
implements Packet<ClientStatusPacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable StringThe field for thecachedStatusrecord component.private static final RegistryOps<JsonElement> private final ServerStatusThe field for thestatusrecord component.static final StreamCodec<FriendlyByteBuf, ClientboundStatusResponsePacket> static final StreamCodec<io.netty.buffer.ByteBuf, ClientboundStatusResponsePacket> -
Constructor Summary
ConstructorsConstructorDescriptionClientboundStatusResponsePacket(ServerStatus status, @Nullable String cachedStatus) Creates an instance of aClientboundStatusResponsePacketrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringReturns the value of thecachedStatusrecord component.final booleanIndicates whether some other object is "equal to" this one.voidhandle(ClientStatusPacketListener listener) Passes this Packet on to the NetHandler for processing.final inthashCode()Returns a hash code value for this object.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.type()Methods inherited from interface Packet
isSkippable, isTerminal
-
Field Details
-
status
The field for thestatusrecord component. -
cachedStatus
The field for thecachedStatusrecord component. -
OPS
-
VANILLA_STREAM_CODEC
public static final StreamCodec<io.netty.buffer.ByteBuf, ClientboundStatusResponsePacket> VANILLA_STREAM_CODEC -
STREAM_CODEC
-
-
Constructor Details
-
ClientboundStatusResponsePacket
-
ClientboundStatusResponsePacket
Creates an instance of aClientboundStatusResponsePacketrecord class.- Parameters:
status- the value for thestatusrecord componentcachedStatus- the value for thecachedStatusrecord component
-
-
Method Details
-
type
- Specified by:
typein interfacePacket<ClientStatusPacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handlein interfacePacket<ClientStatusPacketListener>
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
cachedStatus
Returns the value of thecachedStatusrecord component.- Returns:
- the value of the
cachedStatusrecord component
-