diff options
| author | jani270 <69345714+jani270@users.noreply.github.com> | 2022-06-04 19:35:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-04 19:35:57 +0200 |
| commit | 1dcfd9774f30fe3d7357a48ca94cfa0fcf277e1b (patch) | |
| tree | 4e390f9666c8abbc40fbf742989727cb9137a97c /src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java | |
| parent | 73dbbed409a86328144f2c75f460426e7baa6ae1 (diff) | |
| download | notenoughupdates-1dcfd9774f30fe3d7357a48ca94cfa0fcf277e1b.tar.gz notenoughupdates-1dcfd9774f30fe3d7357a48ca94cfa0fcf277e1b.tar.bz2 notenoughupdates-1dcfd9774f30fe3d7357a48ca94cfa0fcf277e1b.zip | |
Useful Changes (#153)
* Added Trophy Fish Fished to 3rd page of pv
* Useful changes
Co-Authored-By: efefury <69400149+efefury@users.noreply.github.com>
Co-authored-by: efefury <69400149+efefury@users.noreply.github.com>
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, |
