aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <roman.graef@gmail.com>2022-09-29 17:25:37 +0200
committerGitHub <noreply@github.com>2022-09-29 17:25:37 +0200
commit2dd4a2b36211c380c0bf4e231859dfafd3c04a5b (patch)
tree20cde26c05f32699ccb91cda1d37b67f4eea6c62 /src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
parentcbcc4c3b4004cbf3f86aeab515ea94a93b4efd1e (diff)
downloadnotenoughupdates-2dd4a2b36211c380c0bf4e231859dfafd3c04a5b.tar.gz
notenoughupdates-2dd4a2b36211c380c0bf4e231859dfafd3c04a5b.tar.bz2
notenoughupdates-2dd4a2b36211c380c0bf4e231859dfafd3c04a5b.zip
Add custom keystore and refactor HypixelApi.java (#318)
* Add custom keystore and refactor HypixelApi.java * Fix inputstream leak (+ less console spam) * Fix HOTM crash * Use api selected variable to find best profile * Number formatting * Make old profiles show again Co-authored-by: nopo <nopotheemail@gmail.com>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
index 4e920aea..f3a09fcc 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
@@ -61,8 +61,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -431,11 +429,10 @@ public class SBInfo {
}
public void updateMayor() {
- NotEnoughUpdates.INSTANCE.manager.hypixelApi.getHypixelApiAsync(
- NotEnoughUpdates.INSTANCE.config.apiData.apiKey,
- "resources/skyblock/election",
- new HashMap<>()
- ).thenAcceptAsync(newJson -> mayorJson = newJson);
+ NotEnoughUpdates.INSTANCE.manager.apiUtils
+ .newHypixelApiRequest("resources/skyblock/election")
+ .requestJson()
+ .thenAccept(newJson -> mayorJson = newJson);
}