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
FieldsModifier and TypeFieldDescriptionprivate final intThe field for thechunkRadiusrecord component.private final CommonPlayerSpawnInfoThe field for thecommonPlayerSpawnInforecord component.private final booleanThe field for thedoLimitedCraftingrecord component.private final booleanThe field for theenforcesSecureChatrecord component.private final booleanThe field for thehardcorerecord component.private final Set<ResourceKey<Level>> The field for thelevelsrecord component.private final intThe field for themaxPlayersrecord component.private final intThe field for theplayerIdrecord component.private final booleanThe field for thereducedDebugInforecord component.private final booleanThe field for theshowDeathScreenrecord component.private final intThe field for thesimulationDistancerecord component.static final StreamCodec<RegistryFriendlyByteBuf, ClientboundLoginPacket> -
Constructor Summary
ConstructorsModifierConstructorDescriptionClientboundLoginPacket(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 aClientboundLoginPacketrecord class.privateClientboundLoginPacket(RegistryFriendlyByteBuf p_321545_) -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thechunkRadiusrecord component.Returns the value of thecommonPlayerSpawnInforecord component.booleanReturns the value of thedoLimitedCraftingrecord component.booleanReturns the value of theenforcesSecureChatrecord component.final booleanIndicates whether some other object is "equal to" this one.voidhandle(ClientGamePacketListener p_132397_) booleanhardcore()Returns the value of thehardcorerecord component.final inthashCode()Returns a hash code value for this object.levels()Returns the value of thelevelsrecord component.intReturns the value of themaxPlayersrecord component.intplayerId()Returns the value of theplayerIdrecord component.booleanReturns the value of thereducedDebugInforecord component.booleanReturns the value of theshowDeathScreenrecord component.intReturns the value of thesimulationDistancerecord component.final StringtoString()Returns a string representation of this record class.type()private voidwrite(RegistryFriendlyByteBuf p_321845_) 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
-
playerId
private final int playerIdThe field for theplayerIdrecord component. -
hardcore
private final boolean hardcoreThe field for thehardcorerecord component. -
levels
The field for thelevelsrecord component. -
maxPlayers
private final int maxPlayersThe field for themaxPlayersrecord component. -
chunkRadius
private final int chunkRadiusThe field for thechunkRadiusrecord component. -
simulationDistance
private final int simulationDistanceThe field for thesimulationDistancerecord component. -
reducedDebugInfo
private final boolean reducedDebugInfoThe field for thereducedDebugInforecord component. -
showDeathScreen
private final boolean showDeathScreenThe field for theshowDeathScreenrecord component. -
doLimitedCrafting
private final boolean doLimitedCraftingThe field for thedoLimitedCraftingrecord component. -
commonPlayerSpawnInfo
The field for thecommonPlayerSpawnInforecord component. -
enforcesSecureChat
private final boolean enforcesSecureChatThe field for theenforcesSecureChatrecord 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 aClientboundLoginPacketrecord class.- Parameters:
playerId- the value for theplayerIdrecord componenthardcore- the value for thehardcorerecord componentlevels- the value for thelevelsrecord componentmaxPlayers- the value for themaxPlayersrecord componentchunkRadius- the value for thechunkRadiusrecord componentsimulationDistance- the value for thesimulationDistancerecord componentreducedDebugInfo- the value for thereducedDebugInforecord componentshowDeathScreen- the value for theshowDeathScreenrecord componentdoLimitedCrafting- the value for thedoLimitedCraftingrecord componentcommonPlayerSpawnInfo- the value for thecommonPlayerSpawnInforecord componentenforcesSecureChat- the value for theenforcesSecureChatrecord component
-
-
Method Details
-
write
-
type
- Specified by:
typein interfacePacket<ClientGamePacketListener>
-
handle
- Specified by:
handlein 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 theplayerIdrecord component.- Returns:
- the value of the
playerIdrecord component
-
hardcore
public boolean hardcore()Returns the value of thehardcorerecord component.- Returns:
- the value of the
hardcorerecord component
-
levels
Returns the value of thelevelsrecord component.- Returns:
- the value of the
levelsrecord component
-
maxPlayers
public int maxPlayers()Returns the value of themaxPlayersrecord component.- Returns:
- the value of the
maxPlayersrecord component
-
chunkRadius
public int chunkRadius()Returns the value of thechunkRadiusrecord component.- Returns:
- the value of the
chunkRadiusrecord component
-
simulationDistance
public int simulationDistance()Returns the value of thesimulationDistancerecord component.- Returns:
- the value of the
simulationDistancerecord component
-
reducedDebugInfo
public boolean reducedDebugInfo()Returns the value of thereducedDebugInforecord component.- Returns:
- the value of the
reducedDebugInforecord component
-
showDeathScreen
public boolean showDeathScreen()Returns the value of theshowDeathScreenrecord component.- Returns:
- the value of the
showDeathScreenrecord component
-
doLimitedCrafting
public boolean doLimitedCrafting()Returns the value of thedoLimitedCraftingrecord component.- Returns:
- the value of the
doLimitedCraftingrecord component
-
commonPlayerSpawnInfo
Returns the value of thecommonPlayerSpawnInforecord component.- Returns:
- the value of the
commonPlayerSpawnInforecord component
-
enforcesSecureChat
public boolean enforcesSecureChat()Returns the value of theenforcesSecureChatrecord component.- Returns:
- the value of the
enforcesSecureChatrecord component
-