aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-07-07 14:06:05 +0200
committerLinnea Gräf <nea@nea.moe>2025-07-07 14:06:05 +0200
commitfac140907e2144789f25d67bc9a82f0382f3bbb9 (patch)
treedbdc0b80714e9e345138a699e6dbaab0d53ca6b8
parent8e4e3499636b5662b167ffbb4f501888912f7ceb (diff)
downloadFirmament-perftest.tar.gz
Firmament-perftest.tar.bz2
Firmament-perftest.zip
perftestperftest
-rw-r--r--src/main/kotlin/repo/ItemCache.kt11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/kotlin/repo/ItemCache.kt b/src/main/kotlin/repo/ItemCache.kt
index 14decd8..acbf2f3 100644
--- a/src/main/kotlin/repo/ItemCache.kt
+++ b/src/main/kotlin/repo/ItemCache.kt
@@ -196,10 +196,17 @@ object ItemCache : IReloadable {
}
@ExpensiveItemCacheApi
- fun NEUItem?.asItemStack(idHint: SkyblockId? = null, loreReplacements: Map<String, String>? = null): ItemStack {
+ fun NEUItem?.asItemStack(
+ idHint: SkyblockId? = null,
+ loreReplacements: Map<String, String>? = null,
+ isCacheRebuild: Boolean = false
+ ): ItemStack {
if (this == null) return brokenItemStack(null, idHint)
var s = cache[this.skyblockItemId]
if (s == null) {
+ if (!isCacheRebuild) {
+ println("NON CACHE REBUILD DETECT! PREPARE TO BE TERMINATED!")
+ }
s = asItemStackNow()
cache[this.skyblockItemId] = s
}
@@ -266,7 +273,7 @@ object ItemCache : IReloadable {
items.values.chunked(500).map { chunk ->
async {
chunk.forEach {
- it.asItemStack() // Rebuild cache
+ it.asItemStack(isCacheRebuild = true) // Rebuild cache
}
}
}.awaitAll()