Tolerate some identifiers. Should fix #1063

This commit is contained in:
creeper123123321 2018-10-31 16:26:55 -03:00
parent eb5c10d375
commit b7606aece0
No known key found for this signature in database
GPG Key ID: 0AC57D54786721D1

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));