Refactor handbook generation to not use naked textmap getter

This commit is contained in:
AnimeGitB
2022-10-15 23:57:47 +10:30
parent 4a5a7bd6bd
commit f3a5bc16a8
2 changed files with 48 additions and 39 deletions

View File

@@ -378,19 +378,23 @@ public final class Language {
private static Int2ObjectMap<TextStrings> textMapStrings;
private static final Path TEXTMAP_CACHE_PATH = Path.of(Utils.toFilePath("cache/TextMapCache.bin"));
@Deprecated(forRemoval = true)
public static Int2ObjectMap<TextStrings> getTextMapStrings() {
if (textMapStrings == null)
loadTextMaps();
return textMapStrings;
}
public static TextStrings getTextMapKey(long hash) {
int key = (int) hash;
public static TextStrings getTextMapKey(int key) {
if ((textMapStrings == null) || (!scannedTextmaps && !textMapStrings.containsKey(key)))
loadTextMaps();
return textMapStrings.get(key);
}
public static TextStrings getTextMapKey(long hash) {
return getTextMapKey((int) hash);
}
public static void loadTextMaps() {
// Check system timestamps on cache and resources
try {