mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 10:05:12 +01:00
Fixed 1.7 UUID, oops. Thanks @MineTheCube
This commit is contained in:
parent
b15c93c416
commit
ff1554556e
@ -114,9 +114,9 @@ public class BaseProtocol extends Protocol {
|
||||
info.setState(State.PLAY);
|
||||
// Save other info
|
||||
String stringUUID = wrapper.get(Type.STRING, 0);
|
||||
if (stringUUID.length() == 28) {
|
||||
if (stringUUID.length() == 32) { // Trimmed UUIDs are 32 characters
|
||||
// Trimmed
|
||||
stringUUID = stringUUID.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5");
|
||||
stringUUID = addDashes(stringUUID);
|
||||
}
|
||||
UUID uuid = UUID.fromString(stringUUID);
|
||||
info.setUuid(uuid);
|
||||
@ -237,4 +237,13 @@ public class BaseProtocol extends Protocol {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static String addDashes(String trimmedUUID) {
|
||||
StringBuffer idBuff = new StringBuffer(trimmedUUID);
|
||||
idBuff.insert(20, '-');
|
||||
idBuff.insert(16, '-');
|
||||
idBuff.insert(12, '-');
|
||||
idBuff.insert(8, '-');
|
||||
return idBuff.toString();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user