diff options
author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2022-06-16 11:41:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-16 13:41:19 +0200 |
commit | 439fc22ff04b0f5b0201c2d982bceb18d82fd553 (patch) | |
tree | c68a66bef486bacf615a037b2cb35d748fcff69d /src/main/java/io | |
parent | 7b427b5a6cac1afe064a8225a5749557ac0aad62 (diff) | |
download | NotEnoughUpdates-439fc22ff04b0f5b0201c2d982bceb18d82fd553.tar.gz NotEnoughUpdates-439fc22ff04b0f5b0201c2d982bceb18d82fd553.tar.bz2 NotEnoughUpdates-439fc22ff04b0f5b0201c2d982bceb18d82fd553.zip |
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
Diffstat (limited to 'src/main/java/io')
2 files changed, 23 insertions, 8 deletions
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<String, JsonElement> 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<String, TrophyFish> trophyFishList = new HashMap<>(); private static final Map<String, Integer> total = new HashMap<>(); @@ -197,18 +198,30 @@ public class TrophyFishingPage { ); ArrayList<TrophyFish> 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<TrophyFish.TrophyFishRarity, Integer> 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); } } |