screen padding

This commit is contained in:
nea
2022-08-04 04:26:51 +02:00
parent c83890afc8
commit 05a4a5b381
5 changed files with 85 additions and 21 deletions

View File

@@ -4,6 +4,8 @@ import com.mojang.serialization.Dynamic
import io.github.moulberry.repo.IReloadable
import io.github.moulberry.repo.NEURepository
import io.github.moulberry.repo.data.NEUItem
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import moe.nea.notenoughupdates.NotEnoughUpdates
import moe.nea.notenoughupdates.util.LegacyTagParser
import moe.nea.notenoughupdates.util.appendLore
@@ -70,7 +72,18 @@ object ItemCache : IReloadable {
ResourceLocation("skyblockitem", skyblockItemId.lowercase().replace(";", "__"))
var job: Job? = null
override fun reload(repository: NEURepository) {
cache.clear()
val j = job
if (j != null && j.isActive) {
j.cancel()
job = NotEnoughUpdates.coroutineScope.launch {
repository.items?.items?.values?.forEach {
it.asItemStack() // Rebuild cache
}
}
}
}
}