From be846c2e984c7fba625d4379d2f524bb26066d1a Mon Sep 17 00:00:00 2001 From: Sauilitired Date: Mon, 27 Oct 2014 22:32:24 +0100 Subject: [PATCH] Updated to use the new API :D --- .../plot/uuid/PlotUUIDSaver.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/PlotSquared/src/com/intellectualcrafters/plot/uuid/PlotUUIDSaver.java b/PlotSquared/src/com/intellectualcrafters/plot/uuid/PlotUUIDSaver.java index 2cfbf4b24..5790cabac 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/uuid/PlotUUIDSaver.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/uuid/PlotUUIDSaver.java @@ -63,25 +63,13 @@ public class PlotUUIDSaver extends UUIDSaver { } - private static String insertDashUUID(String uuid) { - StringBuffer sb = new StringBuffer(uuid); - sb.insert(8, "-"); - sb = new StringBuffer(sb.toString()); - sb.insert(13, "-"); - sb = new StringBuffer(sb.toString()); - sb.insert(18, "-"); - sb = new StringBuffer(sb.toString()); - sb.insert(23, "-"); - return sb.toString(); - } - public UUID mojangUUID(String name) throws Exception { URLConnection connection = new URL(Settings.API_URL + "?user=" + name).openConnection(); connection.addRequestProperty("User-Agent", "Mozilla/4.0"); JSONTokener tokener = new JSONTokener(connection.getInputStream()); JSONObject root = new JSONObject(tokener); - String uuid = root.getJSONObject(name).getString("uuid"); - return UUID.fromString(insertDashUUID(uuid)); + String uuid = root.getJSONObject(name).getString("dashed"); + return UUID.fromString(uuid); } public String mojangName(UUID uuid) throws Exception {