aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-26 15:47:38 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-26 15:47:38 +0100
commit1ee923243faa4abbc9110891c92d4a227f5daf08 (patch)
tree66b458d367469e2f0f7089ca630be8ffde534afc /src/main/java/at/hannibal2/skyhanni/data
parenta5540841c951f2f694cf48f8dd093f69e9d36c44 (diff)
downloadskyhanni-1ee923243faa4abbc9110891c92d4a227f5daf08.tar.gz
skyhanni-1ee923243faa4abbc9110891c92d4a227f5daf08.tar.bz2
skyhanni-1ee923243faa4abbc9110891c92d4a227f5daf08.zip
Migrate Hypixel API to v2.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt b/src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt
index 53ffdae71..231f059d1 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt
@@ -2,11 +2,11 @@ package at.hannibal2.skyhanni.data
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigManager
+import at.hannibal2.skyhanni.data.jsonobjects.local.MayorJson
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.utils.APIUtil
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.put
-import at.hannibal2.skyhanni.data.jsonobjects.local.MayorJson
import io.github.moulberry.notenoughupdates.util.SkyBlockTime
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
@@ -40,7 +40,7 @@ class MayorElection {
if (System.currentTimeMillis() > lastUpdate + 60_000 * 5) {
lastUpdate = System.currentTimeMillis()
SkyHanniMod.coroutineScope.launch {
- val url = "https://api.hypixel.net/resources/skyblock/election"
+ val url = "https://api.hypixel.net/v2/resources/skyblock/election"
val jsonObject = withContext(dispatcher) { APIUtil.getJSONResponse(url) }
rawMayorData = ConfigManager.gson.fromJson(jsonObject, MayorJson::class.java)
val data = rawMayorData ?: return@launch