From 2dd4a2b36211c380c0bf4e231859dfafd3c04a5b Mon Sep 17 00:00:00 2001 From: Roman / Linnea Gräf Date: Thu, 29 Sep 2022 17:25:37 +0200 Subject: 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 --- .../io/github/moulberry/notenoughupdates/util/SBInfo.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java') 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); } -- cgit