99import cn .xiaopangxie732 .mojang_api .util .Net ;
1010
1111/**
12- * To get UUID of username.
12+ * To get UUID of username(playername) .
1313 * @author XiaoPangxie732
1414 */
1515public class UserName {
@@ -18,7 +18,7 @@ public class UserName {
1818 private static Gson json = new Gson ();
1919
2020 /**
21- * Get the UUID of this player name at a time.
21+ * Get the UUID of this playername at a time.
2222 * @param username The playername needs to get UUID.
2323 * @param timestamp A UNIX timestamp (without milliseconds).
2424 * @return The UUID of the name at the timestamp provided.
@@ -42,7 +42,7 @@ public static String UUIDAtTime(String username, long timestamp) throws Username
4242 }
4343
4444 /**
45- * Get the UUID of this player name at now.
45+ * Get the UUID of this playername at now.
4646 * @param username The playername needs to get UUID.
4747 * @return The UUID of the name at now.
4848 * @throws UsernameOrTimestampInvalidException When the username is invalid.
@@ -62,7 +62,7 @@ public static String UUIDAtNow(String username) throws UsernameOrTimestampInvali
6262 }
6363
6464 /**
65- * Get the UUID of this player name at original time (timestamp=0).
65+ * Get the UUID of this playername at original time (timestamp=0).
6666 * @param username The playername needs to get UUID.
6767 * @return The UUID of the name at the original.
6868 * @throws UsernameOrTimestampInvalidException When the username is invalid or playername wasn't change at least once.
@@ -73,6 +73,13 @@ public static String UUIDAtOriginal(String username) throws UsernameOrTimestampI
7373 return UUIDAtTime (username , 0 );
7474 }
7575
76+ /**
77+ * Get the UUID of the playername(s).
78+ * @param usernames The playername(s) needs to get UUID.
79+ * @return The UUID(s) of the playername(s).
80+ * @throws IllegalArgumentException When the request names reached more than 100.
81+ * @throws IllegalArgumentException when any of the usernames is <code>null</code> or <code>""</code>.
82+ */
7683 public static String UUIDOfNames (String ... usernames ) throws IllegalArgumentException {
7784 if (usernames .length > 100 ) throw new IllegalArgumentException ("Too more names! (" + usernames .length + "/100)" );
7885 String response = Net .postConnection ("https://api.mojang.com/profiles/minecraft" , "application/json" , json .toJson (usernames ));
0 commit comments