From 90b3225afdd5e43c54e82d73478f2c2f1e046f80 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Mon, 10 Oct 2022 11:20:16 +0000 Subject: Set everyones branch back to master (#348) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../notenoughupdates/NotEnoughUpdates.java | 8 +++++++ .../profileviewer/trophy/TrophyFishPage.java | 26 ++++++++++++---------- 2 files changed, 22 insertions(+), 12 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index 3f535d68..39826ded 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -261,6 +261,14 @@ public class NotEnoughUpdates { if (config.profileViewer.pageLayout.size() == 9) { config.profileViewer.pageLayout.add(9); } + + // Remove after 2.1 ig + if ("dangerous".equals(config.apiData.repoBranch) || "rune".equals(config.apiData.repoBranch)) { + config.apiData.repoBranch = "master"; + } else if ("jani270".equals(config.apiData.repoUser)) { + config.apiData.repoUser = "NotEnoughUpdates"; + } + saveConfig(); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java index e6c69649..cda47ffd 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java @@ -26,11 +26,6 @@ import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewerPage; import io.github.moulberry.notenoughupdates.util.Utils; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; @@ -43,6 +38,13 @@ import org.apache.commons.lang3.text.WordUtils; import org.apache.commons.lang3.tuple.Pair; import org.lwjgl.opengl.GL11; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + public class TrophyFishPage extends GuiProfileViewerPage { public static final ResourceLocation pv_elements = new ResourceLocation("notenoughupdates:pv_elements.png"); @@ -339,9 +341,9 @@ public class TrophyFishPage extends GuiProfileViewerPage { private List getTooltip(String name, Map trophyFishRarityIntegerMap) { List tooltip = new ArrayList<>(); - tooltip.add(internalTrophyFish.get(name.toLowerCase().replace(" ", "_")) + WordUtils.capitalize(name.replace("_", " "))); + tooltip.add(internalTrophyFish.get(name.toLowerCase(Locale.US).replace(" ", "_")) + WordUtils.capitalize(name.replace("_", " "))); - List lore = readLoreFromRepo(name.toUpperCase()); + List lore = readLoreFromRepo(name.toUpperCase(Locale.US)); List description = readDescriptionFromLore(lore); tooltip.addAll(description); tooltip.add(" "); @@ -363,7 +365,7 @@ public class TrophyFishPage extends GuiProfileViewerPage { TrophyFish.TrophyFishRarity rarity, EnumChatFormatting color ) { - String name = WordUtils.capitalize(rarity.name().toLowerCase()); + String name = WordUtils.capitalize(rarity.name().toLowerCase(Locale.US)); if (trophyFishRarityIntegerMap == null) { return color + name + ": " + checkX; } @@ -376,7 +378,7 @@ public class TrophyFishPage extends GuiProfileViewerPage { } private ItemStack getItem(String name) { - String repoName = name.toUpperCase().replace(" ", "_") + "_BRONZE"; + String repoName = name.toUpperCase(Locale.US).replace(" ", "_") + "_BRONZE"; JsonObject jsonItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(repoName); return NotEnoughUpdates.INSTANCE.manager.jsonToStack(jsonItem); } @@ -402,7 +404,7 @@ public class TrophyFishPage extends GuiProfileViewerPage { type = s[2]; } try { - trophyFishRarity = TrophyFish.TrophyFishRarity.valueOf(type.toUpperCase()); + trophyFishRarity = TrophyFish.TrophyFishRarity.valueOf(type.toUpperCase(Locale.US)); } catch (IllegalArgumentException ignored) { total.put(WordUtils.capitalize(key), value); continue; @@ -441,7 +443,7 @@ public class TrophyFishPage extends GuiProfileViewerPage { private List fixStringName(List list) { List fixedList = new ArrayList<>(); for (String s : list) { - fixedList.add(s.toLowerCase().replace(" ", "_")); + fixedList.add(s.toLowerCase(Locale.US).replace(" ", "_")); } return fixedList; } @@ -463,7 +465,7 @@ public class TrophyFishPage extends GuiProfileViewerPage { } private List readLoreFromRepo(String name) { - String repoName = name.toUpperCase().replace(" ", "_") + "_BRONZE"; + String repoName = name.toUpperCase(Locale.US).replace(" ", "_") + "_BRONZE"; JsonObject jsonItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(repoName); List list = new ArrayList<>(); -- cgit