diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2022-09-30 02:30:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-29 20:30:30 -0400 |
commit | af846d805939692eab57282851da106c125877d3 (patch) | |
tree | 70e242beef739d746dfe4a1c5aec38d9d081612f /src/main/java/io | |
parent | 2dd4a2b36211c380c0bf4e231859dfafd3c04a5b (diff) | |
download | NotEnoughUpdates-af846d805939692eab57282851da106c125877d3.tar.gz NotEnoughUpdates-af846d805939692eab57282851da106c125877d3.tar.bz2 NotEnoughUpdates-af846d805939692eab57282851da106c125877d3.zip |
useless change (#321)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/io')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionSortModeWarning.java | 82 |
1 files changed, 39 insertions, 43 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionSortModeWarning.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionSortModeWarning.java index 8ac0151a..ed05ee79 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionSortModeWarning.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionSortModeWarning.java @@ -45,50 +45,46 @@ public class AuctionSortModeWarning { } public void onPostGuiRender() { - if (isAuctionBrowser()) { - GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; - - ItemStack stack = chest.inventorySlots.getSlot(50).getStack(); - - if (stack != null) { - List<String> tooltip = stack.getTooltip(Minecraft.getMinecraft().thePlayer, false); - - String selectedSort = null; - for (String line : tooltip) { - if (line.startsWith("\u00a75\u00a7o\u00a7b\u25B6 ")) { - selectedSort = Utils.cleanColour(line.substring("\u00a75\u00a7o\u00a7b\u25B6 ".length())); - } - } - - if (selectedSort != null) { - if (!selectedSort.trim().equals("Lowest Price")) { - GlStateManager.disableLighting(); - GlStateManager.pushMatrix(); - GlStateManager.translate(0, 0, 500); - - String selectedColour = "\u00a7e"; - - if (selectedSort.trim().equals("Highest Price")) { - selectedColour = "\u00a7c"; - } - - String warningText = "\u00a7aSort: " + selectedColour + selectedSort; - int warningLength = Minecraft.getMinecraft().fontRendererObj.getStringWidth(warningText); - - int centerX = - ((AccessorGuiContainer) chest).getGuiLeft() + ((AccessorGuiContainer) chest).getXSize() / 2 + 9; - int centerY = ((AccessorGuiContainer) chest).getGuiTop() + 26; - - RenderUtils.drawFloatingRectDark(centerX - warningLength / 2 - 4, centerY - 6, - warningLength + 8, 12, false - ); - TextRenderUtils.drawStringCenteredScaledMaxWidth(warningText, Minecraft.getMinecraft().fontRendererObj, - centerX, centerY, true, chest.width / 2, 0xffffffff - ); - GlStateManager.popMatrix(); - } - } + if (!isAuctionBrowser()) return; + GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; + + ItemStack stack = chest.inventorySlots.getSlot(50).getStack(); + + if (stack == null) return; + List<String> tooltip = stack.getTooltip(Minecraft.getMinecraft().thePlayer, false); + + String selectedSort = null; + for (String line : tooltip) { + if (line.startsWith("\u00a75\u00a7o\u00a7b\u25B6 ")) { + selectedSort = Utils.cleanColour(line.substring("\u00a75\u00a7o\u00a7b\u25B6 ".length())); } } + + if (selectedSort == null) return; + if (selectedSort.trim().equals("Lowest Price")) return; + GlStateManager.disableLighting(); + GlStateManager.pushMatrix(); + GlStateManager.translate(0, 0, 500); + + String selectedColour = "\u00a7e"; + + if (selectedSort.trim().equals("Highest Price")) { + selectedColour = "\u00a7c"; + } + + String warningText = "\u00a7aSort: " + selectedColour + selectedSort; + int warningLength = Minecraft.getMinecraft().fontRendererObj.getStringWidth(warningText); + + int centerX = + ((AccessorGuiContainer) chest).getGuiLeft() + ((AccessorGuiContainer) chest).getXSize() / 2 + 9; + int centerY = ((AccessorGuiContainer) chest).getGuiTop() + 26; + + RenderUtils.drawFloatingRectDark(centerX - warningLength / 2 - 4, centerY - 6, + warningLength + 8, 12, false + ); + TextRenderUtils.drawStringCenteredScaledMaxWidth(warningText, Minecraft.getMinecraft().fontRendererObj, + centerX, centerY, true, chest.width / 2, 0xffffffff + ); + GlStateManager.popMatrix(); } } |