From fa0506c05ae2c509c39161a9b1487fafa4b8b5c9 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Mon, 1 Jul 2024 20:56:34 +0200 Subject: Clear CIT cache on repo reload --- src/main/java/moe/nea/caelo/optifine/OptifineCustomItemCache.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/moe/nea/caelo/optifine/OptifineCustomItemCache.kt b/src/main/java/moe/nea/caelo/optifine/OptifineCustomItemCache.kt index f343958..ed5068e 100644 --- a/src/main/java/moe/nea/caelo/optifine/OptifineCustomItemCache.kt +++ b/src/main/java/moe/nea/caelo/optifine/OptifineCustomItemCache.kt @@ -3,6 +3,8 @@ package moe.nea.caelo.optifine import moe.nea.caelo.CaeloCommand import moe.nea.caelo.config.CConfig import moe.nea.caelo.event.NeaTickEvent +import moe.nea.caelo.event.ResourceReloadEvent +import moe.nea.caelo.optifine.OptifineRegexCache.cache import moe.nea.caelo.util.Histogram import moe.nea.caelo.util.MC import net.minecraft.item.ItemStack @@ -64,6 +66,11 @@ object OptifineCustomItemCache { private val cacheSizeHistory = Histogram(1000) private var cacheStats = CacheStats() + @SubscribeEvent + fun onResourcePackReload(resourceReload: ResourceReloadEvent) { + map.clear() + } + @SubscribeEvent fun onTick(event: NeaTickEvent) { var removeCount = 0 -- cgit