Record Class CommonPlayerSpawnInfo

java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.CommonPlayerSpawnInfo

public record CommonPlayerSpawnInfo(Holder<DimensionType> dimensionType, ResourceKey<Level> dimension, long seed, GameType gameType, @Nullable GameType previousGameType, boolean isDebug, boolean isFlat, Optional<GlobalPos> lastDeathLocation, int portalCooldown) extends Record
  • Field Details

    • dimensionType

      private final Holder<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.
    • 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.
    • 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.
    • DIMENSION_TYPE_ID_STREAM_CODEC

      private static final StreamCodec<RegistryFriendlyByteBuf,Holder<DimensionType>> DIMENSION_TYPE_ID_STREAM_CODEC
  • Constructor Details

    • CommonPlayerSpawnInfo

      public CommonPlayerSpawnInfo(RegistryFriendlyByteBuf p_331063_)
    • CommonPlayerSpawnInfo

      public CommonPlayerSpawnInfo(Holder<DimensionType> dimensionType, ResourceKey<Level> dimension, long seed, GameType gameType, @Nullable GameType previousGameType, boolean isDebug, boolean isFlat, Optional<GlobalPos> lastDeathLocation, int portalCooldown)
      Creates an instance of a CommonPlayerSpawnInfo record class.
      Parameters:
      dimensionType - the value for the dimensionType record component
      dimension - the value for the dimension record component
      seed - the value for the seed record component
      gameType - the value for the gameType record component
      previousGameType - the value for the previousGameType 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(RegistryFriendlyByteBuf p_335866_)
    • 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.
    • dimensionType

      public Holder<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
    • 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
    • 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