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.private -
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 listener) Passes this Packet on to the NetHandler for processing.final inthashCode()Returns a hash code value for this object.booleanshouldKeep(byte mask) final StringtoString()Returns a string representation of this record class.type()private voidwrite(RegistryFriendlyByteBuf output) Methods inherited from interface Packet
isSkippable, isTerminal
-
Field Details
-
commonPlayerSpawnInfo
The field for thecommonPlayerSpawnInforecord component. -
dataToKeep
private final byte dataToKeepThe field for thedataToKeeprecord 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 aClientboundRespawnPacketrecord class.- Parameters:
commonPlayerSpawnInfo- the value for thecommonPlayerSpawnInforecord componentdataToKeep- the value for thedataToKeeprecord component
-
-
Method Details
-
write
-
type
- Specified by:
typein interfacePacket<ClientGamePacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handlein interfacePacket<ClientGamePacketListener>
-
shouldKeep
public boolean shouldKeep(byte mask) -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
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
-