Solved UUID Help

Discussion in 'Plugin Development' started by HelGod, Apr 16, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    HelGod

    Is there a way to get a player's UUID if the player's name isn't the correct case? For example if I do /getuuid dinnerbone instead of Dinnerbone it would return Dinnerbone's UUID. I am using threUUIDFetcher, but the name has to be the correct case. I am trying to get the UUID of an offline player
     
  2. Offline

    Maurdekye

    HelGod It doesn't work as-is? It should, from what I can tell.
     
    Konkz likes this.
  3. Offline

    SnipsRevival

    What UUIDs are returned when you try Dinnerbone and then dinnerbone?
     
  4. Offline

    HelGod

    Maurdekye
    What do you mean o.o?

    SnipsRevival
    I am using the UUIDFetcher (pointing it out again). when I used Dinnerbone (61699b2e-d327-4a01-9f1e-0ea8c3f06bc6) dinnerbone(null)
     
  5. Offline

    Maurdekye

    HelGod Huh. That's interesting; there should be a way of getting uuids case-insensitive.
     
  6. Offline

    SnipsRevival

    That is strange. I know when I used it, all my player names were completely in lowercase and it worked fine. Can you show us how you are using it?
     
  7. Offline

    HelGod

    SnipsRevival
    Code:java
    1. public static String getUUIDFromName(String name) {
    2. UUIDFetcher fetcher = new UUIDFetcher(Arrays.asList(name));
    3. Map<String, UUID> response = null;
    4. try {
    5. response = fetcher.call();
    6. } catch (Exception e) {
    7. e.printStackTrace();
    8. }
    9. return response.get(name).toString();
    10. }
     
  8. Offline

    Alshain01

    The list returned will contain the proper cased name so you need to adjust for that when you do your response.get() since your name variable is not properly cased.
     
  9. Offline

    HelGod

    Alshain01
    Thanks :), that was the problem.
     
    Alshain01 likes this.
Thread Status:
Not open for further replies.

Share This Page