mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-12-25 01:47:39 +01:00
Use length for UUID compat as contains is expensive
This commit is contained in:
parent
071b42c9e0
commit
b15c93c416
@ -114,7 +114,8 @@ public class BaseProtocol extends Protocol {
|
|||||||
info.setState(State.PLAY);
|
info.setState(State.PLAY);
|
||||||
// Save other info
|
// Save other info
|
||||||
String stringUUID = wrapper.get(Type.STRING, 0);
|
String stringUUID = wrapper.get(Type.STRING, 0);
|
||||||
if (!stringUUID.contains("-")) {
|
if (stringUUID.length() == 28) {
|
||||||
|
// Trimmed
|
||||||
stringUUID = stringUUID.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5");
|
stringUUID = stringUUID.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5");
|
||||||
}
|
}
|
||||||
UUID uuid = UUID.fromString(stringUUID);
|
UUID uuid = UUID.fromString(stringUUID);
|
||||||
|
Loading…
Reference in New Issue
Block a user