mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-19 10:24:47 +01:00
Re-generate textmap cache if an error occurs
This commit is contained in:
@@ -85,8 +85,13 @@ public final class Tools {
|
||||
void newTranslatedLine(String template, TextStrings... textstrings) {
|
||||
for (int i = 0; i < TextStrings.NUM_LANGUAGES; i++) {
|
||||
String s = template;
|
||||
for (int j = 0; j < textstrings.length; j++)
|
||||
for (int j = 0; j < textstrings.length; j++) try {
|
||||
s = s.replace("{" + j + "}", textstrings[j].strings[i]);
|
||||
} catch (NullPointerException ignored) {
|
||||
// TextMap cache is outdated.
|
||||
j--; // Retry the action.
|
||||
Language.loadTextMaps(true);
|
||||
}
|
||||
handbookBuilders.get(i).append(s + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user