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 pHandler) 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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.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
public ClientboundStatusResponsePacket(ServerStatus status, @Nullable @Nullable String cachedStatus) 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
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. 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
-