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
-
Constructor Summary
ConstructorDescriptionClientboundRespawnPacket
(FriendlyByteBuf p_179191_) ClientboundRespawnPacket
(CommonPlayerSpawnInfo commonPlayerSpawnInfo, byte dataToKeep) Creates an instance of aClientboundRespawnPacket
record class. -
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.void
write
(FriendlyByteBuf p_132954_) 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, nextProtocol
-
Field Details
-
commonPlayerSpawnInfo
The field for thecommonPlayerSpawnInfo
record component. -
dataToKeep
private final byte dataToKeepThe field for thedataToKeep
record component. -
KEEP_ATTRIBUTES
public static final byte KEEP_ATTRIBUTES- 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
- Specified by:
write
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
-