Record Class MinecraftAccount

java.lang.Object
java.lang.Record
com.soulfiremc.server.account.MinecraftAccount
Record Components:
authType - The type of authentication
profileId - Identifier that uniquely identifies the account
lastKnownName - The last known name of the account
accountData - The data of the account (values depend on the authType)

public record MinecraftAccount(@NonNull AuthType authType, @NonNull UUID profileId, @NonNull String lastKnownName, @NonNull AccountData accountData) extends Record
Represents an authenticated MC account. This can be a premium, offline or bedrock account. Beware that the profileId is not a valid online UUID for offline and bedrock accounts.
  • Constructor Details

    • MinecraftAccount

      public MinecraftAccount(@NonNull @NonNull AuthType authType, @NonNull @NonNull UUID profileId, @NonNull @NonNull String lastKnownName, @NonNull @NonNull AccountData accountData)
      Creates an instance of a MinecraftAccount record class.
      Parameters:
      authType - the value for the authType record component
      profileId - the value for the profileId record component
      lastKnownName - the value for the lastKnownName record component
      accountData - the value for the accountData record component
  • Method Details

    • fromProto

      public static MinecraftAccount fromProto(MinecraftAccountProto account)
    • forProxyCheck

      public static MinecraftAccount forProxyCheck()
    • toString

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

      public boolean isPremiumJava()
    • isPremiumBedrock

      public boolean isPremiumBedrock()
    • toProto

      public MinecraftAccountProto toProto()
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • authType

      @NonNull public @NonNull AuthType authType()
      Returns the value of the authType record component.
      Returns:
      the value of the authType record component
    • profileId

      @NonNull public @NonNull UUID profileId()
      Returns the value of the profileId record component.
      Returns:
      the value of the profileId record component
    • lastKnownName

      @NonNull public @NonNull String lastKnownName()
      Returns the value of the lastKnownName record component.
      Returns:
      the value of the lastKnownName record component
    • accountData

      @NonNull public @NonNull AccountData accountData()
      Returns the value of the accountData record component.
      Returns:
      the value of the accountData record component