aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/DankersSkyblockMod.java
diff options
context:
space:
mode:
authorMy-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com>2020-12-21 19:24:36 -0500
committerMy-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com>2020-12-21 19:24:36 -0500
commitde0681b5ddd1fb5aeddf1c1dc2ea207ff8087d82 (patch)
tree64ec95bc0e81f65ea98312079f691aa7f330177b /src/main/java/me/Danker/DankersSkyblockMod.java
parent4c8a46fff853b98477bfbd6535c25991a2cae783 (diff)
downloadSkyblockMod-de0681b5ddd1fb5aeddf1c1dc2ea207ff8087d82.tar.gz
SkyblockMod-de0681b5ddd1fb5aeddf1c1dc2ea207ff8087d82.tar.bz2
SkyblockMod-de0681b5ddd1fb5aeddf1c1dc2ea207ff8087d82.zip
Auto-Import API key
Diffstat (limited to 'src/main/java/me/Danker/DankersSkyblockMod.java')
-rw-r--r--src/main/java/me/Danker/DankersSkyblockMod.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java
index 07aa188..bf1d466 100644
--- a/src/main/java/me/Danker/DankersSkyblockMod.java
+++ b/src/main/java/me/Danker/DankersSkyblockMod.java
@@ -424,6 +424,12 @@ public class DankersSkyblockMod {
public void onChat(ClientChatReceivedEvent event) {
String message = StringUtils.stripControlCodes(event.message.getUnformattedText());
+ if (message.startsWith("Your new API key is ") && Utils.isOnHypixel()) {
+ String apiKey = event.message.getSiblings().get(0).getChatStyle().getChatClickEvent().getValue();
+ ConfigHandler.writeStringConfig("api", "APIKey", apiKey);
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Set API key to " + DankersSkyblockMod.SECONDARY_COLOUR + apiKey));
+ }
+
if (!Utils.inSkyblock) return;
// Action Bar