aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/repo
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-06-26 21:22:41 +0200
committerLinnea Gräf <nea@nea.moe>2025-06-26 21:22:41 +0200
commite5ff77c47f2936c34699a56b1394c1b5c18964e8 (patch)
treed11a34b90b7bfbd544b95be9d70d8a4dfdc5b7de /src/main/kotlin/repo
parent04fd3b66df7184db37df3306876bac8f95f8e71a (diff)
downloadFirmament-e5ff77c47f2936c34699a56b1394c1b5c18964e8.tar.gz
Firmament-e5ff77c47f2936c34699a56b1394c1b5c18964e8.tar.bz2
Firmament-e5ff77c47f2936c34699a56b1394c1b5c18964e8.zip
feat: Make use of bazaar stocks for better bazaar prices
Diffstat (limited to 'src/main/kotlin/repo')
-rw-r--r--src/main/kotlin/repo/HypixelStaticData.kt9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/kotlin/repo/HypixelStaticData.kt b/src/main/kotlin/repo/HypixelStaticData.kt
index 3c992f5..b0ada77 100644
--- a/src/main/kotlin/repo/HypixelStaticData.kt
+++ b/src/main/kotlin/repo/HypixelStaticData.kt
@@ -27,7 +27,7 @@ object HypixelStaticData {
private set
var avg7dlowestBin: Map<SkyblockId, Double> = mapOf()
private set
- var bazaarData: Map<SkyblockId, BazaarData> = mapOf()
+ var bazaarData: Map<SkyblockId.BazaarStock, BazaarData> = mapOf()
private set
var collectionData: Map<String, CollectionSkillData> = mapOf()
private set
@@ -58,9 +58,10 @@ object HypixelStaticData {
val products: Map<SkyblockId.BazaarStock, BazaarData> = mapOf(),
)
- fun getPriceOfItem(item: SkyblockId): Double? = bazaarData[item]?.quickStatus?.buyPrice ?: lowestBin[item]
- fun hasBazaarStock(item: SkyblockId): Boolean {
+ fun getPriceOfItem(item: SkyblockId): Double? = bazaarData[SkyblockId.BazaarStock.fromSkyBlockId(item)]?.quickStatus?.buyPrice ?: lowestBin[item]
+
+ fun hasBazaarStock(item: SkyblockId.BazaarStock): Boolean {
return item in bazaarData
}
@@ -105,7 +106,7 @@ object HypixelStaticData {
if (!response.success) {
logger.warn("Retrieved unsuccessful bazaar data")
}
- bazaarData = response.products.mapKeys { it.key.toRepoId() }
+ bazaarData = response.products
}
private suspend fun updateCollectionData() {