Merge pull request #1066 from creeper123123321/master

Tolerate some identifiers. Should fix #1063
This commit is contained in:
Myles 2018-11-01 15:58:31 +00:00 committed by GitHub
commit b9750be745
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -447,7 +447,7 @@ public class InventoryPackets {
case "WDL|REQUEST":
return "wdl:request";
default:
return old.matches("[0-9a-z_-]+:[0-9a-z_/.-]+") // Identifier regex
return old.matches("([0-9a-z_-]*:)?[0-9a-z_/.-]*") // Identifier regex
? old
: "viaversion:legacy/" + BaseEncoding.base32().lowerCase().withPadChar('-').encode(
old.getBytes(StandardCharsets.UTF_8));