diff options
| author | BuildTools <james.jenour@protonmail.com> | 2021-05-06 08:03:15 +0800 |
|---|---|---|
| committer | BuildTools <james.jenour@protonmail.com> | 2021-05-06 08:03:15 +0800 |
| commit | 9aa7b49d224bfde055e12bc84f6908ba0a50090d (patch) | |
| tree | 3485af44e6570b143867ec8867c123435244643e /src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java | |
| parent | 03b9a8dbcc1ebd5f8c39e4733a741a4092ab0a1d (diff) | |
| download | notenoughupdates-9aa7b49d224bfde055e12bc84f6908ba0a50090d.tar.gz notenoughupdates-9aa7b49d224bfde055e12bc84f6908ba0a50090d.tar.bz2 notenoughupdates-9aa7b49d224bfde055e12bc84f6908ba0a50090d.zip | |
fine ironman
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java b/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java index 93887e23..f896f1c2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java @@ -761,6 +761,7 @@ public class APIManager { ci.vanillaItem = isVanillaItem(internalname); JsonObject auctionInfo = getItemAuctionInfo(internalname); + float lowestBin = getLowestBin(internalname); JsonObject bazaarInfo = getBazaarInfo(internalname); if(bazaarInfo != null && bazaarInfo.get("curr_buy") != null) { @@ -768,7 +769,11 @@ public class APIManager { ci.craftCost = bazaarInstantBuyPrice; } //Don't use auction prices for vanilla items cuz people like to transfer money, messing up the cost of vanilla items. - if(auctionInfo != null && !ci.vanillaItem) { + if(lowestBin > 0 && !ci.vanillaItem) { + if(ci.craftCost < 0 || lowestBin < ci.craftCost) { + ci.craftCost = lowestBin; + } + } else if(auctionInfo != null && !ci.vanillaItem) { float auctionPrice = auctionInfo.get("price").getAsFloat() / auctionInfo.get("count").getAsFloat(); if(ci.craftCost < 0 || auctionPrice < ci.craftCost) { ci.craftCost = auctionPrice; |
