Skip to content

Commit

Permalink
Merge pull request #8 from Keriils/fix-langbackup-bug
Browse files Browse the repository at this point in the history
fix bug
  • Loading branch information
Keriils authored Aug 24, 2024
2 parents 4a6a5f3 + 12d8b02 commit 8847ff5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
可以在config/NHUtilities/NHUtilities.cfg文件下配置
默认支持TST BOX 可编程舱室 等mod
需要在和config的同级别路径下(和config在同一个文件夹就行了)
创建`langBackup`这个文件夹
创建`Lang_Backup`(区分大小写 默认自动生成)这个文件夹
将你没装私活的lang文件丢进去就行了
即你的安装包的lang文件扒过去
> 即 GregTech.lang 文件
Expand Down
32 changes: 16 additions & 16 deletions src/main/java/com/xir/NHUtilities/config/ResetLangManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

public class ResetLangManager {

private static final Path mcPath = minecraftHome().toPath();
private static final File Lang_Backup = mcPath.resolve("Lang_Backup").toFile();
private static final File LangManagerFile = cfgDirPath.resolve("LangManagerFile.json")
.toFile();

private static final Path mcPath = minecraftHome().toPath();

private static final File sourceLang_CN = mcPath.resolve("Lang_Backup")
.resolve("GregTech_zh_CN.lang")
.toFile();
Expand All @@ -41,23 +41,23 @@ public class ResetLangManager {
private static final File targetLang_US = mcPath.resolve("GregTech.lang")
.toFile();

//
// private static final Path mcPath = Launch.minecraftHome.toPath();
//
// private static final File sourceLang_CN = mcPath.resolve("Lang_Backup")
// .resolve("GregTech_zh_CN.lang")
// .toFile();
// private static final File sourceLang_US = mcPath.resolve("Lang_Backup")
// .resolve("GregTech.lang")
// .toFile();
// private static final File targetLang_CN = mcPath.resolve("GregTech_zh_CN.lang")
// .toFile();
// private static final File targetLang_US = mcPath.resolve("GregTech.lang")
// .toFile();
static {
if (!Lang_Backup.exists()) {
boolean created = Lang_Backup.mkdirs();
if (created) {
ConfigLog.info("Lang_Backup created: {}", Lang_Backup.getAbsolutePath());
} else {
ConfigLog.warn("An error occurred on creating Lang_Backup dir: {}", Lang_Backup.getAbsolutePath());
}
}
}

public static void checkInit(String[] listeningMods) throws IOException {

if (!sourceLang_CN.exists() || !sourceLang_US.exists()) return;
if (!sourceLang_CN.exists() || !sourceLang_US.exists()) {
ConfigLog.warn("lang files not found");
return;
}

LinkedHashMap<String, String> loadedMods = getLoadedMods(listeningMods);
// generate file
Expand Down

0 comments on commit 8847ff5

Please sign in to comment.