diff options
| author | BuildTools <james.jenour@protonmail.com> | 2021-02-17 22:50:19 +0800 |
|---|---|---|
| committer | BuildTools <james.jenour@protonmail.com> | 2021-02-17 22:50:19 +0800 |
| commit | de834a97505c66b5655ee7ff91e78e84da3f81f3 (patch) | |
| tree | 93eb09a06d02501c060fb0401221d34a5bc24fd8 /src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java | |
| parent | a0e7d174472d034142003e58a42d6beefe36a92b (diff) | |
| download | notenoughupdates-de834a97505c66b5655ee7ff91e78e84da3f81f3.tar.gz notenoughupdates-de834a97505c66b5655ee7ff91e78e84da3f81f3.tar.bz2 notenoughupdates-de834a97505c66b5655ee7ff91e78e84da3f81f3.zip | |
PRE22
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java index 83c7962e..152d201d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java @@ -71,6 +71,7 @@ public class AuctionSearchOverlay { }; public static boolean shouldReplace() { + if(!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) return false; if(!NotEnoughUpdates.INSTANCE.config.auctionHouseSearch.enableSearchOverlay) return false; if(!(Minecraft.getMinecraft().currentScreen instanceof GuiEditSign)) { @@ -159,8 +160,10 @@ public class AuctionSearchOverlay { String itemName = Utils.trimIgnoreColour(stack.getDisplayName().replaceAll("\\[.+]", "")); if(itemName.contains("Enchanted Book") && str.contains(";")) { - itemName = EnumChatFormatting.BLUE+WordUtils.capitalizeFully(str.split(";")[0].replace("_", " ")); + String[] lore = NotEnoughUpdates.INSTANCE.manager.getLoreFromNBT(stack.getTagCompound()); + itemName = lore[0].trim(); } + Minecraft.getMinecraft().fontRendererObj.drawString(Minecraft.getMinecraft().fontRendererObj.trimStringToWidth(itemName, 165), width/2-74, topY+35+num*22+1, 0xdddddd, true); @@ -422,7 +425,11 @@ public class AuctionSearchOverlay { if(mouseX >= width/2-96 && mouseX <= width/2+96 && mouseY >= topY+30+num*22 && mouseY <= topY+30+num*22+20) { searchString = Utils.cleanColour(stack.getDisplayName().replaceAll("\\[.+]", "")).trim(); if(searchString.contains("Enchanted Book") && str.contains(";")) { - searchString = WordUtils.capitalizeFully(str.split(";")[0].replace("_", " ")); + String[] lore = NotEnoughUpdates.INSTANCE.manager.getLoreFromNBT(stack.getTagCompound()); + String[] split = Utils.cleanColour(lore[0]).trim().split(" "); + split[split.length-1] = ""; + + searchString = StringUtils.join(split, " ").trim(); } JsonObject essenceCosts = Constants.ESSENCECOSTS; |
