use of net.minecraft.server.packs.resources.ResourceManager in project MinecraftForge by MinecraftForge.
the class LanguageHook method loadLanguage.
private static void loadLanguage(String langName, MinecraftServer server) {
String langFile = String.format(Locale.ROOT, "lang/%s.json", langName);
ResourceManager resourceManager = server.getServerResources().getResourceManager();
resourceManager.getNamespaces().forEach(namespace -> {
try {
ResourceLocation langResource = new ResourceLocation(namespace, langFile);
loadLocaleData(resourceManager.getResources(langResource));
} catch (FileNotFoundException fnfe) {
} catch (Exception exception) {
LOGGER.warn("Skipped language file: {}:{}", namespace, langFile, exception);
}
});
}
Aggregations