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
FieldsModifier and TypeFieldDescriptionprivate final CommonPlayerSpawnInfoThe field for thecommonPlayerSpawnInforecord component.private final byteThe field for thedataToKeeprecord component.static final bytestatic final bytestatic final bytestatic final StreamCodec<RegistryFriendlyByteBuf, ClientboundRespawnPacket> -
Constructor Summary
ConstructorsModifierConstructorDescriptionClientboundRespawnPacket(CommonPlayerSpawnInfo commonPlayerSpawnInfo, byte dataToKeep) Creates an instance of aClientboundRespawnPacketrecord class.privateClientboundRespawnPacket(RegistryFriendlyByteBuf p_321588_) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecommonPlayerSpawnInforecord component.byteReturns the value of thedataToKeeprecord component.final booleanIndicates whether some other object is "equal to" this one.voidhandle(ClientGamePacketListener p_132951_) final inthashCode()Returns a hash code value for this object.booleanshouldKeep(byte p_263573_) final StringtoString()Returns a string representation of this record class.type()private voidwrite(RegistryFriendlyByteBuf p_321615_) 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
-
commonPlayerSpawnInfo
The field for thecommonPlayerSpawnInforecord component. -
dataToKeep
private final byte dataToKeepThe field for thedataToKeeprecord component. -
STREAM_CODEC
-
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 aClientboundRespawnPacketrecord class.- Parameters:
commonPlayerSpawnInfo- the value for thecommonPlayerSpawnInforecord componentdataToKeep- the value for thedataToKeeprecord component
-
-
Method Details
-
write
-
type
- Specified by:
typein interfacePacket<ClientGamePacketListener>
-
handle
- Specified by:
handlein 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 thecommonPlayerSpawnInforecord component.- Returns:
- the value of the
commonPlayerSpawnInforecord component
-
dataToKeep
public byte dataToKeep()Returns the value of thedataToKeeprecord component.- Returns:
- the value of the
dataToKeeprecord component
-