Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-28 17:10:13 +01:00
Fix channel name validation in 1.13 to 1.12.2 protocol (#2701)
Closes #2187
Dieser Commit ist enthalten in:
Ursprung
e64a0fb62e
Commit
a0f26f1ca3
@ -137,15 +137,17 @@ public class MappingData extends MappingDataBase {
|
|||||||
return null; // Not valid
|
return null; // Not valid
|
||||||
}
|
}
|
||||||
int separatorIndex = newId.indexOf(':');
|
int separatorIndex = newId.indexOf(':');
|
||||||
// Vanilla parses ``:`` and ```` as ``minecraft:`` (also ensure there's enough space)
|
// Vanilla parses an empty and a missing namespace as the minecraft namespace
|
||||||
if ((separatorIndex == -1 || separatorIndex == 0) && newId.length() <= 10) {
|
if (separatorIndex == -1) {
|
||||||
newId = "minecraft:" + newId;
|
newId = "minecraft:" + newId;
|
||||||
|
} else if (separatorIndex == 0) {
|
||||||
|
newId = "minecraft" + newId;
|
||||||
}
|
}
|
||||||
return newId;
|
return newId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isValid1_13Channel(String channelId) {
|
public static boolean isValid1_13Channel(String channelId) {
|
||||||
return channelId.matches("([0-9a-z_.-]+):([0-9a-z_/.-]+)");
|
return channelId.matches("([0-9a-z_.-]+:)?[0-9a-z_/.-]+");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadTags(Map<String, Integer[]> output, JsonObject newTags) {
|
private void loadTags(Map<String, Integer[]> output, JsonObject newTags) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren