diff options
| author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2024-04-27 06:23:28 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-26 22:23:28 +0200 |
| commit | b3ca5b1ffc698ede14d4e9d8ed2dc86711201de1 (patch) | |
| tree | b30f23c9745bfc66c721e7bfdb440a336142871a /src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java | |
| parent | d3106bf41e099d329d9db330ab09e167519fce25 (diff) | |
| download | notenoughupdates-b3ca5b1ffc698ede14d4e9d8ed2dc86711201de1.tar.gz notenoughupdates-b3ca5b1ffc698ede14d4e9d8ed2dc86711201de1.tar.bz2 notenoughupdates-b3ca5b1ffc698ede14d4e9d8ed2dc86711201de1.zip | |
Fix Profile viewer issues with Turkish language (#1116)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java index 2f9ca90b..2b8ebf12 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java @@ -40,6 +40,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; +import java.util.Locale; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -182,7 +183,7 @@ public class PlayerStats { int petScore = 0; for (String value : highestRarityMap.values()) { - petScore += Utils.getElementAsFloat(Utils.getElement(bonuses, "pet_value." + value.toUpperCase()), 0); + petScore += Utils.getElementAsFloat(Utils.getElement(bonuses, "pet_value." + value.toUpperCase(Locale.ROOT)), 0); } return petScore; } @@ -522,7 +523,7 @@ public class PlayerStats { float statMin = min.get("statNums").getAsJsonObject().get(entry.getKey()).getAsFloat(); float val = statMin * minMix + statMax * maxMix; - stats.addStat(entry.getKey().toLowerCase(), (int) Math.floor(val)); + stats.addStat(entry.getKey().toLowerCase(Locale.ROOT), (int) Math.floor(val)); } } @@ -531,7 +532,7 @@ public class PlayerStats { HashMap<String, Float> petStatBootsMult = GuiProfileViewer.PET_STAT_BOOSTS_MULT.get(heldItem); if (petStatBoots != null) { for (Map.Entry<String, Float> entryBoost : petStatBoots.entrySet()) { - String key = entryBoost.getKey().toLowerCase(); + String key = entryBoost.getKey().toLowerCase(Locale.ROOT); try { stats.addStat(key, entryBoost.getValue()); } catch (Exception ignored) {} @@ -539,7 +540,7 @@ public class PlayerStats { } if (petStatBootsMult != null) { for (Map.Entry<String, Float> entryBoost : petStatBootsMult.entrySet()) { - String key = entryBoost.getKey().toLowerCase(); + String key = entryBoost.getKey().toLowerCase(Locale.ROOT); try { stats.scale(key, entryBoost.getValue()); } catch (Exception ignored) {} @@ -664,7 +665,7 @@ public class PlayerStats { return null; } String selectedPower = profileInfo.get(abs).getAsJsonObject().get("selected_power").getAsString(); - return selectedPower.substring(0, 1).toUpperCase() + selectedPower.substring(1); + return selectedPower.substring(0, 1).toUpperCase(Locale.ROOT) + selectedPower.substring(1); } public static @Nullable QuiverInfo getQuiverInfo(Map<String, JsonArray> inventoryInfo, JsonObject profileInfo) { |
