diff options
| author | Lulonaut <lulonaut@lulonaut.tech> | 2023-10-06 15:44:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-06 15:44:59 +0200 |
| commit | 810a25eec4e6712acee145526d3017dd118b8492 (patch) | |
| tree | 9dadcb47bb4d51d5329e48b40899458b104f1de1 /src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java | |
| parent | ebdc4df69093d29c3334537f9267374773464a30 (diff) | |
| download | notenoughupdates-810a25eec4e6712acee145526d3017dd118b8492.tar.gz notenoughupdates-810a25eec4e6712acee145526d3017dd118b8492.tar.bz2 notenoughupdates-810a25eec4e6712acee145526d3017dd118b8492.zip | |
Remove legacy API keys from the code base (#862)
Co-authored-by: nopo <nopotheemail@gmail.com>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java index 9611f197..5f436eb6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java @@ -23,9 +23,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; -import io.github.moulberry.notenoughupdates.events.ProfileDataLoadedEvent; import io.github.moulberry.notenoughupdates.util.kotlin.KotlinTypeAdapterFactory; -import net.minecraft.client.Minecraft; import org.apache.commons.io.IOUtils; import org.apache.http.NameValuePair; import org.apache.http.client.utils.URIBuilder; @@ -104,25 +102,6 @@ public class ApiUtil { } } - public void updateProfileData() { - updateProfileData(Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", "")); - } - - public void updateProfileData(String playerUuid) { - if (true) return; - if (!updateTasks.getOrDefault(playerUuid, CompletableFuture.completedFuture(null)).isDone()) return; - - String uuid = Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", ""); - updateTasks.put(playerUuid, newHypixelApiRequest("skyblock/profiles") - .queryArgument("uuid", uuid) - .requestJson() - .handle((jsonObject, throwable) -> { - new ProfileDataLoadedEvent(uuid, jsonObject).post(); - return null; - })); - - } - public static class Request { private final List<NameValuePair> queryArguments = new ArrayList<>(); @@ -291,7 +270,7 @@ public class ApiUtil { } }, executorService).handle((obj, t) -> { if (t != null) { - System.err.println(ErrorUtil.printStackTraceWithoutApiKey(t)); + t.printStackTrace(); } return obj; }); @@ -320,12 +299,6 @@ public class ApiUtil { return new Request(); } - @Deprecated - public Request newHypixelApiRequest(String apiPath) { - return newAnonymousHypixelApiRequest(apiPath) - .queryArgument("key", NotEnoughUpdates.INSTANCE.config.apiData.apiKey); - } - public Request newAnonymousHypixelApiRequest(String apiPath) { return new Request() .url("https://api.hypixel.net/" + apiPath); |
