From 071b42c9e0df037f05ecf973cee7e17e40ca380a Mon Sep 17 00:00:00 2001 From: Myles Date: Tue, 15 Nov 2016 19:11:40 +0000 Subject: [PATCH] Fix 1.7.2 support when used with ProtocolSupport --- .../us/myles/ViaVersion/protocols/base/BaseProtocol.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/base/BaseProtocol.java b/common/src/main/java/us/myles/ViaVersion/protocols/base/BaseProtocol.java index 82677d8ef..57948db10 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/base/BaseProtocol.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/base/BaseProtocol.java @@ -113,7 +113,11 @@ public class BaseProtocol extends Protocol { ProtocolInfo info = wrapper.user().get(ProtocolInfo.class); info.setState(State.PLAY); // Save other info - UUID uuid = UUID.fromString(wrapper.get(Type.STRING, 0)); + String stringUUID = wrapper.get(Type.STRING, 0); + if (!stringUUID.contains("-")) { + stringUUID = stringUUID.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5"); + } + UUID uuid = UUID.fromString(stringUUID); info.setUuid(uuid); info.setUsername(wrapper.get(Type.STRING, 1)); // Add to ported clients