Package one.tranic.t.base.parse.mojang
Class MojangAPIParser
java.lang.Object
one.tranic.t.base.parse.mojang.MojangAPIParser
MojangAPIParser is a utility class for interacting with the Mojang API to perform profile lookups.
It provides methods to retrieve Minecraft profile information by username, UUID, or a batch of usernames.
Connections are established using the RequestWithProxyParser class to support proxy configurations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ProfileLookuplookupProfile(String name) Looks up a Minecraft profile by its username using the Mojang API.static List<ProfileLookup>lookupProfile(String... names) Retrieves a list of Minecraft profiles by performing a bulk lookup using an array of usernames.static ProfileLookuplookupProfile(UUID uuid) Retrieves the Minecraft profile associated with the given UUID by performing a lookup request to the Mojang API.
-
Constructor Details
-
MojangAPIParser
public MojangAPIParser()
-
-
Method Details
-
lookupProfile
Looks up a Minecraft profile by its username using the Mojang API.- Parameters:
name- the username of the Minecraft profile to be looked up- Returns:
- a
ProfileLookupobject containing the profile's ID and username - Throws:
IOException- if an I/O error occurs while connecting to the Mojang API or parsing the response
-
lookupProfile
Retrieves the Minecraft profile associated with the given UUID by performing a lookup request to the Mojang API.- Parameters:
uuid- the unique identifier of the Minecraft account to look up, must not be null- Returns:
- a
ProfileLookuprecord containing the profile information, including the UUID and username - Throws:
IOException- if an I/O error occurs while making the request or parsing the response
-
lookupProfile
Retrieves a list of Minecraft profiles by performing a bulk lookup using an array of usernames.- Parameters:
names- an array of usernames to be looked up; each name represents a Minecraft user's profile- Returns:
- a list of
ProfileLookuprecords containing the id and name of the queried profiles - Throws:
IOException- if an I/O error occurs during the HTTP request or response handling
-