aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-09-24 00:11:18 +1000
committerGitHub <noreply@github.com>2024-09-23 16:11:18 +0200
commit7c9f889efd9c5d889394f8bf00288ef1c38f8ae4 (patch)
treee8fd52a149573e096fa37389a37dddb47213f545 /src/main/java/at/hannibal2/skyhanni/data
parentf78d580531941d52bbbeca625c3f078beae8996a (diff)
downloadskyhanni-7c9f889efd9c5d889394f8bf00288ef1c38f8ae4.tar.gz
skyhanni-7c9f889efd9c5d889394f8bf00288ef1c38f8ae4.tar.bz2
skyhanni-7c9f889efd9c5d889394f8bf00288ef1c38f8ae4.zip
Backend: Add Http Request Patching (#2578)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt
index b4fb7eaa2..469c48489 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/MayorAPI.kt
@@ -16,7 +16,7 @@ import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.features.fame.ReminderUtils
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
-import at.hannibal2.skyhanni.utils.APIUtil
+import at.hannibal2.skyhanni.utils.APIUtils
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.CollectionUtils.nextAfter
import at.hannibal2.skyhanni.utils.CollectionUtils.put
@@ -216,7 +216,7 @@ object MayorAPI {
SkyHanniMod.coroutineScope.launch {
val url = "https://api.hypixel.net/v2/resources/skyblock/election"
- val jsonObject = withContext(dispatcher) { APIUtil.getJSONResponse(url) }
+ val jsonObject = withContext(dispatcher) { APIUtils.getJSONResponse(url) }
rawMayorData = ConfigManager.gson.fromJson<MayorJson>(jsonObject)
val data = rawMayorData ?: return@launch
val map = mutableMapOf<Int, MayorCandidate>()
diff --git a/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt b/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt
index 29a16944c..13044b7c3 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt
@@ -6,7 +6,7 @@ import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarData
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.test.command.ErrorManager
-import at.hannibal2.skyhanni.utils.APIUtil
+import at.hannibal2.skyhanni.utils.APIUtils
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.ItemUtils.itemName
import at.hannibal2.skyhanni.utils.LorenzUtils
@@ -46,7 +46,7 @@ object HypixelBazaarFetcher {
val fetchType = if (nextFetchIsManual) "manual" else "automatic"
nextFetchIsManual = false
try {
- val jsonResponse = withContext(Dispatchers.IO) { APIUtil.getJSONResponse(URL) }.asJsonObject
+ val jsonResponse = withContext(Dispatchers.IO) { APIUtils.getJSONResponse(URL) }.asJsonObject
val response = ConfigManager.gson.fromJson<BazaarApiResponseJson>(jsonResponse)
if (response.success) {
latestProductInformation = process(response.products)