Record Class ServerboundResourcePackPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.common.ServerboundResourcePackPacket
- All Implemented Interfaces:
Packet<ServerCommonPacketListener>
public record ServerboundResourcePackPacket(UUID id, ServerboundResourcePackPacket.Action action)
extends Record
implements Packet<ServerCommonPacketListener>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ServerboundResourcePackPacket.ActionThe field for theactionrecord component.private final UUIDThe field for theidrecord component.static final StreamCodec<FriendlyByteBuf, ServerboundResourcePackPacket> -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates an instance of aServerboundResourcePackPacketrecord class.privateServerboundResourcePackPacket(FriendlyByteBuf p_295986_) -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.final booleanIndicates whether some other object is "equal to" this one.voidhandle(ServerCommonPacketListener p_296386_) final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.final StringtoString()Returns a string representation of this record class.type()private voidwrite(FriendlyByteBuf p_295360_) 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
-
id
The field for theidrecord component. -
action
The field for theactionrecord component. -
STREAM_CODEC
-
-
Constructor Details
-
ServerboundResourcePackPacket
-
ServerboundResourcePackPacket
Creates an instance of aServerboundResourcePackPacketrecord class.- Parameters:
id- the value for theidrecord componentaction- the value for theactionrecord component
-
-
Method Details
-
write
-
type
- Specified by:
typein interfacePacket<ServerCommonPacketListener>
-
handle
- Specified by:
handlein interfacePacket<ServerCommonPacketListener>
-
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-