diff options
| author | jani270 <69345714+jani270@users.noreply.github.com> | 2023-08-05 15:18:16 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-05 15:18:16 +0200 |
| commit | 286d07910e7df7dc5bd0d22f8df3f53361a010c8 (patch) | |
| tree | f3a3b1b0c6437c8b9c18dfa5354fa3428644d77b /src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java | |
| parent | 2c33629da66bcef0a9300a737f4493eadb5c1b41 (diff) | |
| download | notenoughupdates-286d07910e7df7dc5bd0d22f8df3f53361a010c8.tar.gz notenoughupdates-286d07910e7df7dc5bd0d22f8df3f53361a010c8.tar.bz2 notenoughupdates-286d07910e7df7dc5bd0d22f8df3f53361a010c8.zip | |
Starting to remove api key mentions from NEU (#781)
* Starting to remove api key mentions from NEU
* remove api key error popup
* ooops
---------
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 | 25 |
1 files changed, 0 insertions, 25 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 3b6aed84..e96043fa 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java @@ -26,7 +26,6 @@ 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 net.minecraft.util.EnumChatFormatting; import org.apache.commons.io.IOUtils; import org.apache.http.NameValuePair; import org.apache.http.client.utils.URIBuilder; @@ -53,7 +52,6 @@ import java.security.UnrecoverableKeyException; import java.security.cert.CertificateException; import java.time.Duration; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Comparator; import java.util.HashMap; @@ -288,29 +286,6 @@ public class ApiUtil { } } } catch (IOException e) { - if (conn instanceof HttpURLConnection) { - try { - int code = ((HttpURLConnection) conn).getResponseCode(); - if (code == 403 && baseUrl != null && baseUrl.startsWith("https://api.hypixel.net/")) { - if (!notifiedOfInvalidApiKey) { - NotificationHandler.displayNotification(Arrays.asList( - EnumChatFormatting.RED + EnumChatFormatting.BOLD.toString() + "API request failed", - EnumChatFormatting.RED + "A Request failed because your API key is invalid/not present", - EnumChatFormatting.RED + "Please run " + EnumChatFormatting.BOLD + EnumChatFormatting.GOLD + - "/api new " + - EnumChatFormatting.RESET + EnumChatFormatting.RED + "to fix this.", - EnumChatFormatting.RED + - "If you don't do this, several API related features, such as the profile viewer, will not work.", - EnumChatFormatting.GRAY+"Press X on your keyboard to close this notification." - ), true, false); - notifiedOfInvalidApiKey = true; - } - return ""; - } - } catch (IOException ex) { - throw new RuntimeException(ex); - } - } throw new RuntimeException(e); // We can rethrow, since supplyAsync catches exceptions. } }, executorService).handle((obj, t) -> { |
