package net.glowstone.util;

import java.util.UUID;

/**
 * Utility methods for dealing with UUIDs.
 */
public final class UuidUtils {

    private UuidUtils() {
    }

    public static UUID fromFlatString(String str) {
        // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
        return UUID.fromString(str.substring(0, 8) + "-" + str.substring(8, 12) + "-" + str.substring(12, 16) +
                "-" + str.substring(16, 20) + "-" + str.substring(20, 32));
    }

    public static String toFlatString(UUID uuid) {
        return uuid.toString().replace("-", "");
    }

}

@@ -281,52 +281,40 @@
 urn 
-UUID.fromString(str.substring(0, 8) + %22-%22 + 
+new UUID(Long.parseUnsignedLong(
 str.
@@ -327,99 +327,44 @@
 ing(
-8, 12) + %22-%22 + str.substring(12, 16) +%0A                %22-%22 + str.substring(16, 20) + %22-%22 + 
+0, 16), 16), Long.parseUnsignedLong(
 str.
@@ -377,14 +377,15 @@
 ing(
-20, 32
+16), 16
 ));%0A
@@ -491,17 +491,16 @@
 %22, %22%22);%0A
+
     %7D%0A
-%0A
 %7D%0A

Optimize String to UUID conversion