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 String
The field for thecachedStatus
record component.private final ServerStatus
The field for thestatus
record component.static final StreamCodec
<FriendlyByteBuf, ClientboundStatusResponsePacket> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ClientboundStatusResponsePacket
(FriendlyByteBuf p_179834_) ClientboundStatusResponsePacket
(ServerStatus status, @Nullable String cachedStatus) Creates an instance of aClientboundStatusResponsePacket
record class. -
Method Summary
Modifier and TypeMethodDescription@Nullable String
Returns the value of thecachedStatus
record component.final boolean
Indicates whether some other object is "equal to" this one.void
handle
(ClientStatusPacketListener pHandler) Passes this Packet on to the NetHandler for processing.final int
hashCode()
Returns a hash code value for this object.status()
Returns the value of thestatus
record component.final String
toString()
Returns a string representation of this record class.type()
private void
write
(FriendlyByteBuf p_134899_) Writes the raw packet data to the data stream.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, isTerminal
-
Field Details
-
status
The field for thestatus
record component. -
cachedStatus
The field for thecachedStatus
record component. -
STREAM_CODEC
-
-
Constructor Details
-
ClientboundStatusResponsePacket
-
ClientboundStatusResponsePacket
-
ClientboundStatusResponsePacket
public ClientboundStatusResponsePacket(ServerStatus status, @Nullable @Nullable String cachedStatus) Creates an instance of aClientboundStatusResponsePacket
record class.- Parameters:
status
- the value for thestatus
record componentcachedStatus
- the value for thecachedStatus
record component
-
-
Method Details
-
write
Writes the raw packet data to the data stream. -
type
- Specified by:
type
in interfacePacket<ClientStatusPacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handle
in 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 thestatus
record component.- Returns:
- the value of the
status
record component
-
cachedStatus
Returns the value of thecachedStatus
record component.- Returns:
- the value of the
cachedStatus
record component
-