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 Details

    • playerId

      private final int playerId
      The field for the playerId record component.
    • hardcore

      private final boolean hardcore
      The field for the hardcore record component.
    • gameType

      private final GameType gameType
      The field for the gameType record component.
    • previousGameType

      @Nullable private final GameType previousGameType
      The field for the previousGameType record component.
    • levels

      private final Set<ResourceKey<Level>> levels
      The field for the levels record component.
    • registryHolder

      private final RegistryAccess.Frozen registryHolder
      The field for the registryHolder record component.
    • dimensionType

      private final ResourceKey<DimensionType> dimensionType
      The field for the dimensionType record component.
    • dimension

      private final ResourceKey<Level> dimension
      The field for the dimension record component.
    • seed

      private final long seed
      The field for the seed record component.
    • maxPlayers

      private final int maxPlayers
      The field for the maxPlayers record component.
    • chunkRadius

      private final int chunkRadius
      The field for the chunkRadius record component.
    • simulationDistance

      private final int simulationDistance
      The field for the simulationDistance record component.
    • reducedDebugInfo

      private final boolean reducedDebugInfo
      The field for the reducedDebugInfo record component.
    • showDeathScreen

      private final boolean showDeathScreen
      The field for the showDeathScreen record component.
    • isDebug

      private final boolean isDebug
      The field for the isDebug record component.
    • isFlat

      private final boolean isFlat
      The field for the isFlat record component.
    • lastDeathLocation

      private final Optional<GlobalPos> lastDeathLocation
      The field for the lastDeathLocation record component.
    • portalCooldown

      private final int portalCooldown
      The field for the portalCooldown record component.
    • BUILTIN_CONTEXT_OPS

      private static final RegistryOps<Tag> BUILTIN_CONTEXT_OPS
  • Constructor Details

    • ClientboundLoginPacket

      public ClientboundLoginPacket(FriendlyByteBuf p_178960_)
    • 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 a ClientboundLoginPacket record class.
      Parameters:
      playerId - the value for the playerId record component
      hardcore - the value for the hardcore record component
      gameType - the value for the gameType record component
      previousGameType - the value for the previousGameType record component
      levels - the value for the levels record component
      registryHolder - the value for the registryHolder record component
      dimensionType - the value for the dimensionType record component
      dimension - the value for the dimension record component
      seed - the value for the seed record component
      maxPlayers - the value for the maxPlayers record component
      chunkRadius - the value for the chunkRadius record component
      simulationDistance - the value for the simulationDistance record component
      reducedDebugInfo - the value for the reducedDebugInfo record component
      showDeathScreen - the value for the showDeathScreen record component
      isDebug - the value for the isDebug record component
      isFlat - the value for the isFlat record component
      lastDeathLocation - the value for the lastDeathLocation record component
      portalCooldown - the value for the portalCooldown record component
  • Method Details

    • write

      public void write(FriendlyByteBuf p_132400_)
      Specified by:
      write in interface Packet<ClientGamePacketListener>
    • handle

      public void handle(ClientGamePacketListener p_132397_)
      Specified by:
      handle in interface Packet<ClientGamePacketListener>
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • playerId

      public int playerId()
      Returns the value of the playerId record component.
      Returns:
      the value of the playerId record component
    • hardcore

      public boolean hardcore()
      Returns the value of the hardcore record component.
      Returns:
      the value of the hardcore record component
    • gameType

      public GameType gameType()
      Returns the value of the gameType record component.
      Returns:
      the value of the gameType record component
    • previousGameType

      @Nullable public GameType previousGameType()
      Returns the value of the previousGameType record component.
      Returns:
      the value of the previousGameType record component
    • levels

      public Set<ResourceKey<Level>> levels()
      Returns the value of the levels record component.
      Returns:
      the value of the levels record component
    • registryHolder

      public RegistryAccess.Frozen registryHolder()
      Returns the value of the registryHolder record component.
      Returns:
      the value of the registryHolder record component
    • dimensionType

      public ResourceKey<DimensionType> dimensionType()
      Returns the value of the dimensionType record component.
      Returns:
      the value of the dimensionType record component
    • dimension

      public ResourceKey<Level> dimension()
      Returns the value of the dimension record component.
      Returns:
      the value of the dimension record component
    • seed

      public long seed()
      Returns the value of the seed record component.
      Returns:
      the value of the seed record component
    • maxPlayers

      public int maxPlayers()
      Returns the value of the maxPlayers record component.
      Returns:
      the value of the maxPlayers record component
    • chunkRadius

      public int chunkRadius()
      Returns the value of the chunkRadius record component.
      Returns:
      the value of the chunkRadius record component
    • simulationDistance

      public int simulationDistance()
      Returns the value of the simulationDistance record component.
      Returns:
      the value of the simulationDistance record component
    • reducedDebugInfo

      public boolean reducedDebugInfo()
      Returns the value of the reducedDebugInfo record component.
      Returns:
      the value of the reducedDebugInfo record component
    • showDeathScreen

      public boolean showDeathScreen()
      Returns the value of the showDeathScreen record component.
      Returns:
      the value of the showDeathScreen record component
    • isDebug

      public boolean isDebug()
      Returns the value of the isDebug record component.
      Returns:
      the value of the isDebug record component
    • isFlat

      public boolean isFlat()
      Returns the value of the isFlat record component.
      Returns:
      the value of the isFlat record component
    • lastDeathLocation

      public Optional<GlobalPos> lastDeathLocation()
      Returns the value of the lastDeathLocation record component.
      Returns:
      the value of the lastDeathLocation record component
    • portalCooldown

      public int portalCooldown()
      Returns the value of the portalCooldown record component.
      Returns:
      the value of the portalCooldown record component