refactor: replace statement with expression lambda

This commit is contained in:
Breno A.
2024-06-09 09:15:22 -03:00
Unverified
parent c7119aae68
commit fcd409320d
22 changed files with 118 additions and 176 deletions
+10 -14
View File
@@ -189,12 +189,10 @@ public final class Tools {
achievementDataMap.values().stream()
.filter(AchievementData::isUsed)
.forEach(
data -> {
h.newTranslatedLine(
padAchievementId.formatted(data.getId()) + "{0} - {1}",
data.getTitleTextMapHash(),
data.getDescTextMapHash());
});
data -> h.newTranslatedLine(
padAchievementId.formatted(data.getId()) + "{0} - {1}",
data.getTitleTextMapHash(),
data.getDescTextMapHash()));
// Write txt files
for (int i = 0; i < TextStrings.NUM_LANGUAGES; i++) {
@@ -352,14 +350,12 @@ public final class Tools {
try {
Files.newDirectoryStream(getResourcePath("TextMap"), "TextMap*.json")
.forEach(
path -> {
availableLangList.add(
path.getFileName()
.toString()
.replace("TextMap", "")
.replace(".json", "")
.toLowerCase());
});
path -> availableLangList.add(
path.getFileName()
.toString()
.replace("TextMap", "")
.replace(".json", "")
.toLowerCase()));
} catch (IOException e) {
Grasscutter.getLogger().error("Failed to get available languages:", e);
}