aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-02-06 18:10:52 +0100
committernea <nea@nea.moe>2023-02-08 23:10:42 +0100
commit26686a8b202d453893889d2c35efe1988ba11277 (patch)
tree7181aeb8b4c449bc53e34c5a73d13791cc5ece71 /src/main
parent31812d03e7c4aa47a76cb9bcc3c67406f4fc1a43 (diff)
downloadNotEnoughUpdates-26686a8b202d453893889d2c35efe1988ba11277.tar.gz
NotEnoughUpdates-26686a8b202d453893889d2c35efe1988ba11277.tar.bz2
NotEnoughUpdates-26686a8b202d453893889d2c35efe1988ba11277.zip
Api: Make api response processing more async.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java14
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java4
2 files changed, 9 insertions, 9 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 5ec3724a..ac60ffd9 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java
@@ -292,7 +292,7 @@ public class APIManager {
.newMoulberryRequest("lowestbin.json.gz")
.gunzip()
.requestJson()
- .thenAccept(jsonObject -> {
+ .thenAcceptAsync(jsonObject -> {
if (lowestBins == null) {
lowestBins = new JsonObject();
}
@@ -465,12 +465,12 @@ public class APIManager {
};
manager.apiUtils.newMoulberryRequest("auctionLast.json.gz")
- .gunzip().requestJson().thenAccept(process);
+ .gunzip().requestJson().thenAcceptAsync(process);
manager.apiUtils
.newMoulberryRequest("auction.json.gz")
.gunzip().requestJson()
- .thenAccept(jsonObject -> {
+ .thenAcceptAsync(jsonObject -> {
if (jsonObject.get("success").getAsBoolean()) {
long apiUpdate = (long) jsonObject.get("time").getAsFloat();
if (lastApiUpdate == apiUpdate) {
@@ -683,7 +683,7 @@ public class APIManager {
manager.apiUtils
.newAnonymousHypixelApiRequest("skyblock/auctions")
.requestJson()
- .thenAccept(jsonObject -> {
+ .thenAcceptAsync(jsonObject -> {
if (jsonObject == null) return;
if (jsonObject.get("success").getAsBoolean()) {
@@ -733,7 +733,7 @@ public class APIManager {
manager.apiUtils
.newAnonymousHypixelApiRequest("skyblock/bazaar")
.requestJson()
- .thenAccept(jsonObject -> {
+ .thenAcceptAsync(jsonObject -> {
if (!jsonObject.get("success").getAsBoolean()) return;
craftCost.clear();
@@ -789,7 +789,7 @@ public class APIManager {
public void updateAvgPrices() {
manager.apiUtils
.newMoulberryRequest("auction_averages/3day.json.gz")
- .gunzip().requestJson().thenAccept((jsonObject) -> {
+ .gunzip().requestJson().thenAcceptAsync((jsonObject) -> {
craftCost.clear();
auctionPricesJson = jsonObject;
lastAuctionAvgUpdate = System.currentTimeMillis();
@@ -797,7 +797,7 @@ public class APIManager {
manager.apiUtils
.newMoulberryRequest("auction_averages_lbin/1day.json.gz")
.gunzip().requestJson()
- .thenAccept((jsonObject) -> {
+ .thenAcceptAsync((jsonObject) -> {
auctionPricesAvgLowestBinJson = jsonObject;
});
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java
index 4a7c1939..984a7931 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java
@@ -150,7 +150,7 @@ public class CapeManager {
NotEnoughUpdates.INSTANCE.manager.apiUtils
.newMoulberryRequest("activecapes.json")
.requestJson()
- .thenAccept(jsonObject -> {
+ .thenAcceptAsync(jsonObject -> {
if (jsonObject.get("success").getAsBoolean()) {
lastJsonSync = jsonObject;
@@ -171,7 +171,7 @@ public class CapeManager {
NotEnoughUpdates.INSTANCE.manager.apiUtils
.newMoulberryRequest("permscapes.json")
.requestJson()
- .thenAccept(jsonObject -> {
+ .thenAcceptAsync(jsonObject -> {
if (!jsonObject.get("success").getAsBoolean()) return;
permSyncTries = 0;