Enum Class ProfileInputType

java.lang.Object
java.lang.Enum<ProfileInputType>
com.cryptomorin.xseries.profiles.objects.ProfileInputType
All Implemented Interfaces:
Serializable, Comparable<ProfileInputType>, Constable

public enum ProfileInputType extends Enum<ProfileInputType>
Different types of input patterns that can be used for identifying constructing, and validating various formats that can represent a Profileable.
  • Enum Constant Details

    • TEXTURE_HASH

      public static final ProfileInputType TEXTURE_HASH
      Represents a texture hash pattern. Mojang hashes length are inconsistent, and they don't seem to use uppercase characters.

      Currently, the shortest observed hash value is (lenght: 57): 0a4050e7aacc4539202658fdc339dd182d7e322f9fbcc4d5f99b5718a

      Example: e5461a215b325fbdf892db67b7bfb60ad2bf1580dc968a15dfb304ccd5e74db

    • TEXTURE_URL

      public static final ProfileInputType TEXTURE_URL
      Represents a texture URL pattern that includes the base URL followed by the texture hash pattern.

      Example: http://textures.minecraft.net/texture/e5461a215b325fbdf892db67b7bfb60ad2bf1580dc968a15dfb304ccd5e74db

    • BASE64

      public static final ProfileInputType BASE64
      Represents a Base64 encoded string pattern. The base64 pattern that's checked is not a general base64 pattern, but a pattern that closely represents the base64 genereated by the NBT data.
    • UUID

      public static final ProfileInputType UUID
      Represents a UUID pattern, following the standard UUID format.
    • USERNAME

      public static final ProfileInputType USERNAME
      Represents a username pattern, allowing alphanumeric characters and underscores, with a length of 1 to 16 characters. Minecraft now requires the username to be at least 3 characters long, but older accounts are still around. It also seems that there are a few inactive accounts that use spaces in their usernames?
  • Field Details

    • pattern

      @Internal public final Pattern pattern
      The RegEx pattern associated with the input type.
  • Method Details

    • values

      public static ProfileInputType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ProfileInputType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getProfile

      public abstract com.mojang.authlib.GameProfile getProfile(String input)
      Retrieves a GameProfile based on the provided input string.
      Parameters:
      input - The input string to retrieve the profile for.
      Returns:
      The GameProfile corresponding to the input string.
    • typeOf

      @Nullable public static @Nullable ProfileInputType typeOf(@NotNull @NotNull String identifier)
      Returns the corresponding ProfileInputType for the given identifier, if it matches any pattern.
      Parameters:
      identifier - The string to be checked against the patterns.
      Returns:
      The matching type, or null if no match is found.