From 439fc22ff04b0f5b0201c2d982bceb18d82fd553 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Thu, 16 Jun 2022 11:41:19 +0000 Subject: added colours to fishing tab (#166) * Added color background to the back of the fishing tab * Fixed missing enchants not working with shiny items * added my name to everything i had done in 2.1.md cos idk why i didnt before --- .../listener/ItemTooltipListener.java | 2 +- .../profileviewer/trophy/TrophyFishingPage.java | 29 ++++++++++++++++------ 2 files changed, 23 insertions(+), 8 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java index fab02bf9..e7da8628 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java @@ -155,7 +155,7 @@ public class ItemTooltipListener { for (int j = 0; j < Utils.rarityArrC.length; j++) { for (Map.Entry entry : enchantsObj.entrySet()) { if (line.contains(Utils.rarityArrC[j] + " " + entry.getKey()) || line.contains( - Utils.rarityArrC[j] + " DUNGEON " + entry.getKey())) { + Utils.rarityArrC[j] + " DUNGEON " + entry.getKey()) || line.contains("SHINY " + Utils.rarityArrC[j].replaceAll("§.§.","") + " DUNGEON " + entry.getKey())) { allItemEnchs = entry.getValue().getAsJsonArray(); break out; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishingPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishingPage.java index 6063dee0..ece6f275 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishingPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishingPage.java @@ -114,6 +114,7 @@ public class TrophyFishingPage { private static final ResourceLocation TROPHY_FISH_TEXTURE = new ResourceLocation( "notenoughupdates:pv_trophy_fish_tab.png"); + public static final ResourceLocation pv_elements = new ResourceLocation("notenoughupdates:pv_elements.png"); private static final Map trophyFishList = new HashMap<>(); private static final Map total = new HashMap<>(); @@ -197,18 +198,30 @@ public class TrophyFishingPage { ); ArrayList arrayList = new ArrayList<>(trophyFishList.values()); - arrayList.sort((c1, c2) -> { - if (c1.getTotal() > c2.getTotal()) return -1; - if (c1.getTotal() < c2.getTotal()) return 1; - return 0; - }); + arrayList.sort((c1, c2) -> Integer.compare(c2.getTotal(), c1.getTotal())); int x; int y; for (TrophyFish value : arrayList) { - RenderHelper.enableGUIStandardItemLighting(); x = guiLeft + slotLocations.get(arrayList.indexOf(value)).getLeft(); y = guiTop + slotLocations.get(arrayList.indexOf(value)).getRight(); + RenderHelper.enableGUIStandardItemLighting(); + Minecraft.getMinecraft().getTextureManager().bindTexture(pv_elements); + Map trophyFishRarityIntegerMap = value.getTrophyFishRarityIntegerMap(); + if (trophyFishRarityIntegerMap.containsKey(TrophyFish.TrophyFishRarity.BRONZE)) { + GlStateManager.color(255/255f, 130/255f, 0/255f, 1); + } + if (trophyFishRarityIntegerMap.containsKey(TrophyFish.TrophyFishRarity.SILVER)) { + GlStateManager.color(192/255f, 192/255f, 192/255f, 1); + } + if (trophyFishRarityIntegerMap.containsKey(TrophyFish.TrophyFishRarity.GOLD)) { + GlStateManager.color(1, 0.82F, 0, 1); + } + if (trophyFishRarityIntegerMap.containsKey(TrophyFish.TrophyFishRarity.DIAMOND)) { + GlStateManager.color(31/255f, 216/255f, 241/255f, 1); + } + Utils.drawTexturedRect(x - 2 , y - 2, 20, 20, 0, 20 / 256f, 0, 20 / 256f, GL11.GL_NEAREST); + GlStateManager.color(1, 1, 1, 1); Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI( getItem(value.getName()), x, @@ -255,9 +268,11 @@ public class TrophyFishingPage { -1, Minecraft.getMinecraft().fontRendererObj ); + GlStateManager.color(1, 1, 1, 1); } - } + Minecraft.getMinecraft().getTextureManager().bindTexture(pv_elements); + Utils.drawTexturedRect(x - 2 , y - 2, 20, 20, 0, 20 / 256f, 0, 20 / 256f, GL11.GL_NEAREST); } } -- cgit