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 final ServerStatusThe field for thestatusrecord component.static final StreamCodec<FriendlyByteBuf, ClientboundStatusResponsePacket> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateClientboundStatusResponsePacket(FriendlyByteBuf p_179834_) ClientboundStatusResponsePacket(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 p_134896_) 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()private voidwrite(FriendlyByteBuf p_134899_) 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. -
STREAM_CODEC
-
-
Constructor Details
-
ClientboundStatusResponsePacket
-
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
-
write
-
type
- Specified by:
typein interfacePacket<ClientStatusPacketListener>
-
handle
- 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
-