3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-09 01:30:13 +01:00

Merge pull request #1633 from KennyTV/abstraction

Put translation values into correct map
Dieser Commit ist enthalten in:
Myles 2020-01-16 09:50:45 +00:00 committet von GitHub
Commit c9abd745c5
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 6 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -77,14 +77,16 @@ public class MappingData {
} }
for (String line : lines) { for (String line : lines) {
if (line.isEmpty()) continue; if (line.isEmpty()) continue;
String[] keyAndTranslation = line.split("=", 2); String[] keyAndTranslation = line.split("=", 2);
if (keyAndTranslation.length != 2) continue; if (keyAndTranslation.length != 2) continue;
String key = keyAndTranslation[0]; String key = keyAndTranslation[0];
String translation = keyAndTranslation[1].replaceAll("%(\\d\\$)?d", "%$1s");
if (!translateData.containsKey(key)) { if (!translateData.containsKey(key)) {
translateMapping.put(key, translation); String translation = keyAndTranslation[1].replaceAll("%(\\d\\$)?d", "%$1s");
mojangTranslation.put(key, translation);
} else { } else {
String dataValue = translateData.get(keyAndTranslation[0]); String dataValue = translateData.get(key);
if (dataValue != null) { if (dataValue != null) {
translateMapping.put(key, dataValue); translateMapping.put(key, dataValue);
} }