diff options
| author | ohowe <42757516+carelesshippo@users.noreply.github.com> | 2021-05-05 18:13:28 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-05 18:13:28 -0600 |
| commit | 4d9e538ced80728bca74491698347333f515bfcc (patch) | |
| tree | e272c853cb9ebe7eb8334e405060bc820ee129fd /src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java | |
| parent | 59d3bf67d93d0204d0dc493508d9d9c2a24cd10b (diff) | |
| parent | 9aa7b49d224bfde055e12bc84f6908ba0a50090d (diff) | |
| download | notenoughupdates-4d9e538ced80728bca74491698347333f515bfcc.tar.gz notenoughupdates-4d9e538ced80728bca74491698347333f515bfcc.tar.bz2 notenoughupdates-4d9e538ced80728bca74491698347333f515bfcc.zip | |
Merge pull request #2 from Moulberry/master
x
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; |
