Class ProfileRequest

java.lang.Object
net.citizensnpcs.npc.profile.ProfileRequest

public class ProfileRequest extends Object
Stores basic information about a single profile used to request profiles from the Mojang servers.

Also stores the result of the request.

  • Constructor Details

    • ProfileRequest

      public ProfileRequest(String playerName, ProfileFetchHandler handler)
      Constructor.
      Parameters:
      playerName - The name of the player whose profile is being requested.
      handler - Optional handler to handle the result for the profile. Handler always invoked from the main thread.
  • Method Details

    • addHandler

      public void addHandler(ProfileFetchHandler handler)
      Add one time result handler.

      Handler is always invoked from the main thread.

      Parameters:
      handler - The result handler.
    • getPlayerName

      public String getPlayerName()
      Get the name of the player the requested profile belongs to.
    • getProfile

      @Nullable public com.mojang.authlib.GameProfile getProfile()
      Get the game profile that was requested.
      Returns:
      The game profile or null if the profile has not been retrieved yet or there was an error while retrieving the profile.
    • getResult

      public ProfileFetchResult getResult()
      Get the result of the profile fetch.