diff options
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java | 6 | ||||
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java | 28 |
2 files changed, 17 insertions, 17 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 7c58cb4d..29b5f4a5 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java @@ -123,7 +123,7 @@ public class APIManager { public class Auction { public String auctioneerUuid; public long end; - public int starting_bid; + public long starting_bid; public int highest_bid_amount; public int bid_count; public boolean bin; @@ -137,7 +137,7 @@ public class APIManager { public int enchLevel = 0; //0 = clean, 1 = ench, 2 = ench/hpb public Auction( - String auctioneerUuid, long end, int starting_bid, int highest_bid_amount, int bid_count, + String auctioneerUuid, long end, long starting_bid, int highest_bid_amount, int bid_count, boolean bin, String category, String rarity, int dungeonTier, String item_tag_str ) { this.auctioneerUuid = auctioneerUuid; @@ -540,7 +540,7 @@ public class APIManager { String auctionUuid = auction.get("uuid").getAsString(); String auctioneerUuid = auction.get("auctioneer").getAsString(); long end = auction.get("end").getAsLong(); - int starting_bid = auction.get("starting_bid").getAsInt(); + long starting_bid = auction.get("starting_bid").getAsLong(); int highest_bid_amount = auction.get("highest_bid_amount").getAsInt(); int bid_count = auction.get("bids").getAsJsonArray().size(); boolean bin = false; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java b/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java index d8fedecb..f0ef1ec6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java @@ -94,7 +94,7 @@ public class CustomAH extends Gui { private boolean shouldUpdateSearch = false; private boolean shouldSortItems = false; - private int startingBid = 0; + private long startingBid = 0; private String currentAucId = null; private int clickedMainCategory = -1; @@ -640,7 +640,7 @@ public class CustomAH extends Gui { } } if (priceNumbers.length() > 0) { - startingBid = Integer.parseInt(priceNumbers.toString()); + startingBid = Long.parseLong(priceNumbers.toString()); } } } @@ -1578,18 +1578,18 @@ public class CustomAH extends Gui { if (auc2 == null) return -1; if (sortMode == SORT_MODE_HIGH) { - int price1 = Math.max(auc1.highest_bid_amount, auc1.starting_bid); - int price2 = Math.max(auc2.highest_bid_amount, auc2.starting_bid); - int diff = price2 - price1; + long price1 = Math.max(auc1.highest_bid_amount, auc1.starting_bid); + long price2 = Math.max(auc2.highest_bid_amount, auc2.starting_bid); + long diff = price2 - price1; if (diff != 0) { - return diff; + return Long.compare(price2, price1); } } else if (sortMode == SORT_MODE_LOW) { - int price1 = Math.max(auc1.highest_bid_amount, auc1.starting_bid); - int price2 = Math.max(auc2.highest_bid_amount, auc2.starting_bid); - int diff = price1 - price2; + long price1 = Math.max(auc1.highest_bid_amount, auc1.starting_bid); + long price2 = Math.max(auc2.highest_bid_amount, auc2.starting_bid); + long diff = price1 - price2; if (diff != 0) { - return diff; + return Long.compare(price1, price2); } } else { long end1 = auc1.end; @@ -1679,16 +1679,16 @@ public class CustomAH extends Gui { priceField.setText((int) (priceI * factor) + end); } - private int getPriceFilterAmount() { + private long getPriceFilterAmount() { return getNumberFromTextBox(priceFilterField); } - private int getNumberFromTextBox(GuiTextField textField) { + private long getNumberFromTextBox(GuiTextField textField) { if (textField.getText().equals("")) { return -2; } try { - int parsed = Integer.parseInt(textField.getText()); + long parsed = Long.parseLong(textField.getText()); if (parsed < 0) { return -1; } @@ -1698,7 +1698,7 @@ public class CustomAH extends Gui { } } - private int getBinPriceFilterAmount() { + private long getBinPriceFilterAmount() { return getNumberFromTextBox(binPriceFilterField); } |