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, Holder<DimensionType> dimensionType, ResourceKey<Level> dimension, long seed, int maxPlayers, int chunkRadius, int simulationDistance, boolean reducedDebugInfo, boolean showDeathScreen, boolean isDebug, boolean isFlat)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for thechunkRadiusrecord component.private final ResourceKey<Level>The field for thedimensionrecord component.private final Holder<DimensionType>The field for thedimensionTyperecord component.private final GameTypeThe field for thegameTyperecord component.private final booleanThe field for thehardcorerecord component.private final booleanThe field for theisDebugrecord component.private final booleanThe field for theisFlatrecord 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 GameTypeThe field for thepreviousGameTyperecord component.private final booleanThe field for thereducedDebugInforecord component.private final RegistryAccess.FrozenThe field for theregistryHolderrecord component.private final longThe field for theseedrecord component.private final booleanThe field for theshowDeathScreenrecord component.private final intThe field for thesimulationDistancerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionClientboundLoginPacket(int playerId, boolean hardcore, GameType gameType, GameType previousGameType, Set<ResourceKey<Level>> levels, RegistryAccess.Frozen registryHolder, Holder<DimensionType> dimensionType, ResourceKey<Level> dimension, long seed, int maxPlayers, int chunkRadius, int simulationDistance, boolean reducedDebugInfo, boolean showDeathScreen, boolean isDebug, boolean isFlat) Creates an instance of aClientboundLoginPacketrecord class.ClientboundLoginPacket(FriendlyByteBuf p_178960_) -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thechunkRadiusrecord component.Returns the value of thedimensionrecord component.Returns the value of thedimensionTyperecord component.final booleanIndicates whether some other object is "equal to" this one.gameType()Returns the value of thegameTyperecord component.voidhandle(ClientGamePacketListener p_132397_) booleanhardcore()Returns the value of thehardcorerecord component.final inthashCode()Returns a hash code value for this object.booleanisDebug()Returns the value of theisDebugrecord component.booleanisFlat()Returns the value of theisFlatrecord component.levels()Returns the value of thelevelsrecord component.intReturns the value of themaxPlayersrecord component.intplayerId()Returns the value of theplayerIdrecord component.Returns the value of thepreviousGameTyperecord component.booleanReturns the value of thereducedDebugInforecord component.Returns the value of theregistryHolderrecord component.longseed()Returns the value of theseedrecord component.booleanReturns the value of theshowDeathScreenrecord component.intReturns the value of thesimulationDistancerecord component.final StringtoString()Returns a string representation of this record class.voidwrite(FriendlyByteBuf p_132400_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.Packet
isSkippable
-
Field Details
-
playerId
private final int playerIdThe field for theplayerIdrecord component. -
hardcore
private final boolean hardcoreThe field for thehardcorerecord component. -
gameType
The field for thegameTyperecord component. -
previousGameType
The field for thepreviousGameTyperecord component. -
levels
The field for thelevelsrecord component. -
registryHolder
The field for theregistryHolderrecord component. -
dimensionType
The field for thedimensionTyperecord component. -
dimension
The field for thedimensionrecord component. -
seed
private final long seedThe field for theseedrecord 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. -
isDebug
private final boolean isDebugThe field for theisDebugrecord component. -
isFlat
private final boolean isFlatThe field for theisFlatrecord component.
-
-
Constructor Details
-
ClientboundLoginPacket
-
ClientboundLoginPacket
public ClientboundLoginPacket(int playerId, boolean hardcore, GameType gameType, @Nullable GameType previousGameType, Set<ResourceKey<Level>> levels, RegistryAccess.Frozen registryHolder, Holder<DimensionType> dimensionType, ResourceKey<Level> dimension, long seed, int maxPlayers, int chunkRadius, int simulationDistance, boolean reducedDebugInfo, boolean showDeathScreen, boolean isDebug, boolean isFlat) Creates an instance of aClientboundLoginPacketrecord class.- Parameters:
playerId- the value for theplayerIdrecord componenthardcore- the value for thehardcorerecord componentgameType- the value for thegameTyperecord componentpreviousGameType- the value for thepreviousGameTyperecord componentlevels- the value for thelevelsrecord componentregistryHolder- the value for theregistryHolderrecord componentdimensionType- the value for thedimensionTyperecord componentdimension- the value for thedimensionrecord componentseed- the value for theseedrecord 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 componentisDebug- the value for theisDebugrecord componentisFlat- the value for theisFlatrecord component
-
-
Method Details
-
write
- Specified by:
writein 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
-
gameType
Returns the value of thegameTyperecord component.- Returns:
- the value of the
gameTyperecord component
-
previousGameType
Returns the value of thepreviousGameTyperecord component.- Returns:
- the value of the
previousGameTyperecord component
-
levels
Returns the value of thelevelsrecord component.- Returns:
- the value of the
levelsrecord component
-
registryHolder
Returns the value of theregistryHolderrecord component.- Returns:
- the value of the
registryHolderrecord component
-
dimensionType
Returns the value of thedimensionTyperecord component.- Returns:
- the value of the
dimensionTyperecord component
-
dimension
Returns the value of thedimensionrecord component.- Returns:
- the value of the
dimensionrecord component
-
seed
public long seed()Returns the value of theseedrecord component.- Returns:
- the value of the
seedrecord 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
-
isDebug
public boolean isDebug()Returns the value of theisDebugrecord component.- Returns:
- the value of the
isDebugrecord component
-
isFlat
public boolean isFlat()Returns the value of theisFlatrecord component.- Returns:
- the value of the
isFlatrecord component
-