Record Class ClientboundRespawnPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundRespawnPacket
- All Implemented Interfaces:
Packet<ClientGamePacketListener>
public record ClientboundRespawnPacket(CommonPlayerSpawnInfo commonPlayerSpawnInfo, byte dataToKeep)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final CommonPlayerSpawnInfo
The field for thecommonPlayerSpawnInfo
record component.private final byte
The field for thedataToKeep
record component.static final byte
static final byte
static final byte
static final StreamCodec
<RegistryFriendlyByteBuf, ClientboundRespawnPacket> -
Constructor Summary
ModifierConstructorDescriptionClientboundRespawnPacket
(CommonPlayerSpawnInfo commonPlayerSpawnInfo, byte dataToKeep) Creates an instance of aClientboundRespawnPacket
record class.private
ClientboundRespawnPacket
(RegistryFriendlyByteBuf p_329401_) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecommonPlayerSpawnInfo
record component.byte
Returns the value of thedataToKeep
record component.final boolean
Indicates whether some other object is "equal to" this one.void
handle
(ClientGamePacketListener p_132951_) final int
hashCode()
Returns a hash code value for this object.boolean
shouldKeep
(byte p_263573_) final String
toString()
Returns a string representation of this record class.type()
private void
write
(RegistryFriendlyByteBuf p_332270_) 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
-
commonPlayerSpawnInfo
The field for thecommonPlayerSpawnInfo
record component. -
dataToKeep
private final byte dataToKeepThe field for thedataToKeep
record component. -
STREAM_CODEC
-
KEEP_ATTRIBUTE_MODIFIERS
public static final byte KEEP_ATTRIBUTE_MODIFIERS- See Also:
-
KEEP_ENTITY_DATA
public static final byte KEEP_ENTITY_DATA- See Also:
-
KEEP_ALL_DATA
public static final byte KEEP_ALL_DATA- See Also:
-
-
Constructor Details
-
ClientboundRespawnPacket
-
ClientboundRespawnPacket
Creates an instance of aClientboundRespawnPacket
record class.- Parameters:
commonPlayerSpawnInfo
- the value for thecommonPlayerSpawnInfo
record componentdataToKeep
- the value for thedataToKeep
record component
-
-
Method Details
-
write
-
type
- Specified by:
type
in interfacePacket<ClientGamePacketListener>
-
handle
- Specified by:
handle
in interfacePacket<ClientGamePacketListener>
-
shouldKeep
public boolean shouldKeep(byte p_263573_) -
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
commonPlayerSpawnInfo
Returns the value of thecommonPlayerSpawnInfo
record component.- Returns:
- the value of the
commonPlayerSpawnInfo
record component
-
dataToKeep
public byte dataToKeep()Returns the value of thedataToKeep
record component.- Returns:
- the value of the
dataToKeep
record component
-