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, GameType gameType, @Nullable GameType previousGameType, Set<ResourceKey<Level>> levels, RegistryAccess.Frozen registryHolder, ResourceKey<DimensionType> dimensionType, ResourceKey<Level> dimension, long seed, int maxPlayers, int chunkRadius, int simulationDistance, boolean reducedDebugInfo, boolean showDeathScreen, boolean isDebug, boolean isFlat, Optional<GlobalPos> lastDeathLocation, int portalCooldown)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final RegistryOps<Tag>
private final int
The field for thechunkRadius
record component.private final ResourceKey<Level>
The field for thedimension
record component.private final ResourceKey<DimensionType>
The field for thedimensionType
record component.private final GameType
The field for thegameType
record component.private final boolean
The field for thehardcore
record component.private final boolean
The field for theisDebug
record component.private final boolean
The field for theisFlat
record component.The field for thelastDeathLocation
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 int
The field for theportalCooldown
record component.private final GameType
The field for thepreviousGameType
record component.private final boolean
The field for thereducedDebugInfo
record component.private final RegistryAccess.Frozen
The field for theregistryHolder
record component.private final long
The field for theseed
record component.private final boolean
The field for theshowDeathScreen
record component.private final int
The field for thesimulationDistance
record component. -
Constructor Summary
ConstructorDescriptionClientboundLoginPacket
(int playerId, boolean hardcore, GameType gameType, GameType previousGameType, Set<ResourceKey<Level>> levels, RegistryAccess.Frozen registryHolder, ResourceKey<DimensionType> dimensionType, ResourceKey<Level> dimension, long seed, int maxPlayers, int chunkRadius, int simulationDistance, boolean reducedDebugInfo, boolean showDeathScreen, boolean isDebug, boolean isFlat, Optional<GlobalPos> lastDeathLocation, int portalCooldown) Creates an instance of aClientboundLoginPacket
record class.ClientboundLoginPacket
(FriendlyByteBuf p_178960_) -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the value of thechunkRadius
record component.Returns the value of thedimension
record component.Returns the value of thedimensionType
record component.final boolean
Indicates whether some other object is "equal to" this one.gameType()
Returns the value of thegameType
record component.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.boolean
isDebug()
Returns the value of theisDebug
record component.boolean
isFlat()
Returns the value of theisFlat
record component.Returns the value of thelastDeathLocation
record component.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.int
Returns the value of theportalCooldown
record component.Returns the value of thepreviousGameType
record component.boolean
Returns the value of thereducedDebugInfo
record component.Returns the value of theregistryHolder
record component.long
seed()
Returns the value of theseed
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.void
write
(FriendlyByteBuf p_132400_) 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
-
Field Details
-
playerId
private final int playerIdThe field for theplayerId
record component. -
hardcore
private final boolean hardcoreThe field for thehardcore
record component. -
gameType
The field for thegameType
record component. -
previousGameType
The field for thepreviousGameType
record component. -
levels
The field for thelevels
record component. -
registryHolder
The field for theregistryHolder
record component. -
dimensionType
The field for thedimensionType
record component. -
dimension
The field for thedimension
record component. -
seed
private final long seedThe field for theseed
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. -
isDebug
private final boolean isDebugThe field for theisDebug
record component. -
isFlat
private final boolean isFlatThe field for theisFlat
record component. -
lastDeathLocation
The field for thelastDeathLocation
record component. -
portalCooldown
private final int portalCooldownThe field for theportalCooldown
record component. -
BUILTIN_CONTEXT_OPS
-
-
Constructor Details
-
ClientboundLoginPacket
-
ClientboundLoginPacket
public ClientboundLoginPacket(int playerId, boolean hardcore, GameType gameType, @Nullable GameType previousGameType, Set<ResourceKey<Level>> levels, RegistryAccess.Frozen registryHolder, ResourceKey<DimensionType> dimensionType, ResourceKey<Level> dimension, long seed, int maxPlayers, int chunkRadius, int simulationDistance, boolean reducedDebugInfo, boolean showDeathScreen, boolean isDebug, boolean isFlat, Optional<GlobalPos> lastDeathLocation, int portalCooldown) Creates an instance of aClientboundLoginPacket
record class.- Parameters:
playerId
- the value for theplayerId
record componenthardcore
- the value for thehardcore
record componentgameType
- the value for thegameType
record componentpreviousGameType
- the value for thepreviousGameType
record componentlevels
- the value for thelevels
record componentregistryHolder
- the value for theregistryHolder
record componentdimensionType
- the value for thedimensionType
record componentdimension
- the value for thedimension
record componentseed
- the value for theseed
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 componentisDebug
- the value for theisDebug
record componentisFlat
- the value for theisFlat
record componentlastDeathLocation
- the value for thelastDeathLocation
record componentportalCooldown
- the value for theportalCooldown
record component
-
-
Method Details
-
write
- Specified by:
write
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
-
gameType
Returns the value of thegameType
record component.- Returns:
- the value of the
gameType
record component
-
previousGameType
Returns the value of thepreviousGameType
record component.- Returns:
- the value of the
previousGameType
record component
-
levels
Returns the value of thelevels
record component.- Returns:
- the value of the
levels
record component
-
registryHolder
Returns the value of theregistryHolder
record component.- Returns:
- the value of the
registryHolder
record component
-
dimensionType
Returns the value of thedimensionType
record component.- Returns:
- the value of the
dimensionType
record component
-
dimension
Returns the value of thedimension
record component.- Returns:
- the value of the
dimension
record component
-
seed
public long seed()Returns the value of theseed
record component.- Returns:
- the value of the
seed
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
-
isDebug
public boolean isDebug()Returns the value of theisDebug
record component.- Returns:
- the value of the
isDebug
record component
-
isFlat
public boolean isFlat()Returns the value of theisFlat
record component.- Returns:
- the value of the
isFlat
record component
-
lastDeathLocation
Returns the value of thelastDeathLocation
record component.- Returns:
- the value of the
lastDeathLocation
record component
-
portalCooldown
public int portalCooldown()Returns the value of theportalCooldown
record component.- Returns:
- the value of the
portalCooldown
record component
-