Record Class ClientboundLoginPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundLoginPacket
- All Implemented Interfaces:
Packet<ClientGamePacketListener>
public record ClientboundLoginPacket(int playerId, boolean hardcore, Set<ResourceKey<Level>> levels, int maxPlayers, int chunkRadius, int simulationDistance, boolean reducedDebugInfo, boolean showDeathScreen, boolean doLimitedCrafting, CommonPlayerSpawnInfo commonPlayerSpawnInfo, boolean enforcesSecureChat)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final int
The field for thechunkRadius
record component.private final CommonPlayerSpawnInfo
The field for thecommonPlayerSpawnInfo
record component.private final boolean
The field for thedoLimitedCrafting
record component.private final boolean
The field for theenforcesSecureChat
record component.private final boolean
The field for thehardcore
record component.private final Set
<ResourceKey<Level>> The field for thelevels
record component.private final int
The field for themaxPlayers
record component.private final int
The field for theplayerId
record component.private final boolean
The field for thereducedDebugInfo
record component.private final boolean
The field for theshowDeathScreen
record component.private final int
The field for thesimulationDistance
record component.static final StreamCodec
<RegistryFriendlyByteBuf, ClientboundLoginPacket> -
Constructor Summary
ModifierConstructorDescriptionClientboundLoginPacket
(int playerId, boolean hardcore, Set<ResourceKey<Level>> levels, int maxPlayers, int chunkRadius, int simulationDistance, boolean reducedDebugInfo, boolean showDeathScreen, boolean doLimitedCrafting, CommonPlayerSpawnInfo commonPlayerSpawnInfo, boolean enforcesSecureChat) Creates an instance of aClientboundLoginPacket
record class.private
ClientboundLoginPacket
(RegistryFriendlyByteBuf p_333088_) -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the value of thechunkRadius
record component.Returns the value of thecommonPlayerSpawnInfo
record component.boolean
Returns the value of thedoLimitedCrafting
record component.boolean
Returns the value of theenforcesSecureChat
record component.final boolean
Indicates whether some other object is "equal to" this one.void
handle
(ClientGamePacketListener p_132397_) boolean
hardcore()
Returns the value of thehardcore
record component.final int
hashCode()
Returns a hash code value for this object.levels()
Returns the value of thelevels
record component.int
Returns the value of themaxPlayers
record component.int
playerId()
Returns the value of theplayerId
record component.boolean
Returns the value of thereducedDebugInfo
record component.boolean
Returns the value of theshowDeathScreen
record component.int
Returns the value of thesimulationDistance
record component.final String
toString()
Returns a string representation of this record class.type()
private void
write
(RegistryFriendlyByteBuf p_329645_) 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
-
playerId
private final int playerIdThe field for theplayerId
record component. -
hardcore
private final boolean hardcoreThe field for thehardcore
record component. -
levels
The field for thelevels
record component. -
maxPlayers
private final int maxPlayersThe field for themaxPlayers
record component. -
chunkRadius
private final int chunkRadiusThe field for thechunkRadius
record component. -
simulationDistance
private final int simulationDistanceThe field for thesimulationDistance
record component. -
reducedDebugInfo
private final boolean reducedDebugInfoThe field for thereducedDebugInfo
record component. -
showDeathScreen
private final boolean showDeathScreenThe field for theshowDeathScreen
record component. -
doLimitedCrafting
private final boolean doLimitedCraftingThe field for thedoLimitedCrafting
record component. -
commonPlayerSpawnInfo
The field for thecommonPlayerSpawnInfo
record component. -
enforcesSecureChat
private final boolean enforcesSecureChatThe field for theenforcesSecureChat
record component. -
STREAM_CODEC
-
-
Constructor Details
-
ClientboundLoginPacket
-
ClientboundLoginPacket
public ClientboundLoginPacket(int playerId, boolean hardcore, Set<ResourceKey<Level>> levels, int maxPlayers, int chunkRadius, int simulationDistance, boolean reducedDebugInfo, boolean showDeathScreen, boolean doLimitedCrafting, CommonPlayerSpawnInfo commonPlayerSpawnInfo, boolean enforcesSecureChat) Creates an instance of aClientboundLoginPacket
record class.- Parameters:
playerId
- the value for theplayerId
record componenthardcore
- the value for thehardcore
record componentlevels
- the value for thelevels
record componentmaxPlayers
- the value for themaxPlayers
record componentchunkRadius
- the value for thechunkRadius
record componentsimulationDistance
- the value for thesimulationDistance
record componentreducedDebugInfo
- the value for thereducedDebugInfo
record componentshowDeathScreen
- the value for theshowDeathScreen
record componentdoLimitedCrafting
- the value for thedoLimitedCrafting
record componentcommonPlayerSpawnInfo
- the value for thecommonPlayerSpawnInfo
record componentenforcesSecureChat
- the value for theenforcesSecureChat
record component
-
-
Method Details
-
write
-
type
- Specified by:
type
in interfacePacket<ClientGamePacketListener>
-
handle
- Specified by:
handle
in interfacePacket<ClientGamePacketListener>
-
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 '=='. -
playerId
public int playerId()Returns the value of theplayerId
record component.- Returns:
- the value of the
playerId
record component
-
hardcore
public boolean hardcore()Returns the value of thehardcore
record component.- Returns:
- the value of the
hardcore
record component
-
levels
Returns the value of thelevels
record component.- Returns:
- the value of the
levels
record component
-
maxPlayers
public int maxPlayers()Returns the value of themaxPlayers
record component.- Returns:
- the value of the
maxPlayers
record component
-
chunkRadius
public int chunkRadius()Returns the value of thechunkRadius
record component.- Returns:
- the value of the
chunkRadius
record component
-
simulationDistance
public int simulationDistance()Returns the value of thesimulationDistance
record component.- Returns:
- the value of the
simulationDistance
record component
-
reducedDebugInfo
public boolean reducedDebugInfo()Returns the value of thereducedDebugInfo
record component.- Returns:
- the value of the
reducedDebugInfo
record component
-
showDeathScreen
public boolean showDeathScreen()Returns the value of theshowDeathScreen
record component.- Returns:
- the value of the
showDeathScreen
record component
-
doLimitedCrafting
public boolean doLimitedCrafting()Returns the value of thedoLimitedCrafting
record component.- Returns:
- the value of the
doLimitedCrafting
record component
-
commonPlayerSpawnInfo
Returns the value of thecommonPlayerSpawnInfo
record component.- Returns:
- the value of the
commonPlayerSpawnInfo
record component
-
enforcesSecureChat
public boolean enforcesSecureChat()Returns the value of theenforcesSecureChat
record component.- Returns:
- the value of the
enforcesSecureChat
record component
-