Util UUID Parser

Discussion in 'Resources' started by FisheyLP, Mar 22, 2015.

Thread Status:
Not open for further replies.
  1. Thats the class:
    http://pastebin.com/iAHuqKbt

    Here is an example on how to use it:
    Code:java
    1. UUIDParser u = new UUIDParser("FisheyLP");
    2. System.out.println("UUID: "+u.getUUID());

    Output (UUID):
    Code:
    UUID: 5c0898f3-5ecc-4898-b284-1e44595bc764
    And you do the same thing reverse!
    Code:java
    1. UUIDParser u = new UUIDParser(UUID.fromString("5c0898f3-5ecc-4898-b284-1e44595bc764"));
    2. System.out.println("Name: "+u.getName());

    Output (String):
    Code:
    Name: FisheyLP
    And you can even get the last date where a player changed his name!
    Code:java
    1. UUIDParser u = new UUIDParser("FisheyLP");
    2. System.out.println("Last changed: "+u.getLastChanged());
    3.  

    Output (Date):
    Code:
    Last changed: Mon Feb 09 18:07:32 CET 2015
    And it fixes case errors:
    Code:java
    1. UUIDPatcher u = new UUIDPatcher("fiSheYlP");
    2. System.out.println("Name: "+u.getName());

    Output:
    Code:
    Name: FisheyLP
    I hope you like it :D
     
    Last edited: Mar 22, 2015
    hsndmrts98 and ChipDev like this.
  2. Offline

    Cirno

    It'd be good to note that you can only do this once per minute per user; you can blame Mojang for that lol
    Just as a note, it's better to use a StringBuffer rather than doing "content + inputLine"
     
  3. Offline

    RingOfStorms

    It is only more efficient to use a StringBuilder if you are doing more than one addition. "content" + "other content" creates one string builder to add the two, so writing out a string builder just for that is redundant and a waste of room. If you do "content" + "content 2" + ... + "content n" that is when you'd want to make a string builder, because there will be a new string builder for every single operation.
     
  4. Offline

    Cirno

    True; I usually write code that assumes you'll be handling large amounts of data rather than a single line like most Mojang profiles do.
     
Thread Status:
Not open for further replies.

Share This Page