diff options
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java index a787ca99..3bae4715 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java @@ -42,8 +42,7 @@ public class AuctionBINWarning extends GuiElement { private boolean isALoss = true; private boolean shouldPerformCheck() { - if (!NotEnoughUpdates.INSTANCE.config.ahTweaks.enableBINWarning || - !NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) { + if (!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) { sellingTooltip = null; showWarning = false; return false; @@ -116,9 +115,15 @@ public class AuctionBINWarning extends GuiElement { if (overcutFactor < 0) overcutFactor = 0; if (overcutFactor > 1) overcutFactor = 1; - if ((sellingPrice > 0 && lowestPrice > 0 && sellingPrice < sellStackAmount * lowestPrice * undercutFactor) - || (sellingPrice > 0 && lowestPrice > 0 && sellingPrice > sellStackAmount * lowestPrice * (overcutFactor + 1)) - || lowestPrice == -1) { + if (lowestPrice == -1) { + return false; + } + if (NotEnoughUpdates.INSTANCE.config.ahTweaks.underCutWarning && + (sellingPrice > 0 && lowestPrice > 0 && sellingPrice < sellStackAmount * lowestPrice * undercutFactor)) { + showWarning = true; + return true; + } else if (NotEnoughUpdates.INSTANCE.config.ahTweaks.overCutWarning && + (sellingPrice > 0 && lowestPrice > 0 && sellingPrice > sellStackAmount * lowestPrice * (overcutFactor + 1))) { showWarning = true; return true; } else { @@ -181,7 +186,9 @@ public class AuctionBINWarning extends GuiElement { width / 2, height / 2 - 45 + 25, false, 170, 0xffffffff ); TextRenderUtils.drawStringCenteredScaledMaxWidth( - (lowestPrice > 0 ? "has a lowest BIN of \u00a76" + lowestPriceStr + "\u00a7r coins" : "\u00a7cWarning: No lowest BIN found!"), + (lowestPrice > 0 + ? "has a lowest BIN of \u00a76" + lowestPriceStr + "\u00a7r coins" + : "\u00a7cWarning: No lowest BIN found!"), Minecraft.getMinecraft().fontRendererObj, width / 2, height / 2 - 45 + 34, @@ -194,12 +201,11 @@ public class AuctionBINWarning extends GuiElement { buyPercentage = sellingPrice * 100 / (lowestPrice * sellStackAmount); isALoss = false; } else if (sellingPrice < lowestPrice * sellStackAmount) { - buyPercentage = 100 - sellingPrice * 100 / (lowestPrice * sellStackAmount); + buyPercentage = 100 - sellingPrice * 100 / (lowestPrice * sellStackAmount); if (buyPercentage <= 0) buyPercentage = 1; isALoss = true; } - TextRenderUtils.drawStringCenteredScaledMaxWidth( "Continue selling it for", Minecraft.getMinecraft().fontRendererObj, @@ -210,7 +216,8 @@ public class AuctionBINWarning extends GuiElement { 0xffa0a0a0 ); TextRenderUtils.drawStringCenteredScaledMaxWidth( - "\u00a76" + sellingPriceStr + "\u00a7r coins?" + (lowestPrice > 0 ? "(\u00a7" + (isALoss ? "c-" : "a+") + buyPercentage + "%\u00a7r)" : ""), + "\u00a76" + sellingPriceStr + "\u00a7r coins?" + + (lowestPrice > 0 ? "(\u00a7" + (isALoss ? "c-" : "a+") + buyPercentage + "%\u00a7r)" : ""), Minecraft.getMinecraft().fontRendererObj, width / 2, height / 2 - 45 + 59, |
