diff options
author | Linnea Gräf <nea@nea.moe> | 2025-04-01 13:40:31 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2025-04-01 13:40:31 +0200 |
commit | 65038b7b370e5e8bc3e4e4d697a42b04a9c825e6 (patch) | |
tree | 87df7eabc820a22bcddd099130d73b664f43b68c /src/texturePacks/java/moe/nea/firmament/features/texturepack | |
parent | 735b3b704f971521256f0b4e67e5e5bfb309e0f5 (diff) | |
download | Firmament-master.tar.gz Firmament-master.tar.bz2 Firmament-master.zip |
Diffstat (limited to 'src/texturePacks/java/moe/nea/firmament/features/texturepack')
2 files changed, 9 insertions, 6 deletions
diff --git a/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomGlobalArmorOverrides.kt b/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomGlobalArmorOverrides.kt index aafc85a..1fe1e08 100644 --- a/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomGlobalArmorOverrides.kt +++ b/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomGlobalArmorOverrides.kt @@ -85,16 +85,19 @@ object CustomGlobalArmorOverrides { ) } + // TODO: BipedEntityRenderer.getEquippedStack create copies of itemstacks for rendering. This means this cache is essentially useless + // If i figure out how to circumvent this (maybe track the origin of those copied itemstacks in some sort of variable in the itemstack to track back the original instance) i should reenable this cache. + // Then also re add this to the cache clearing function val overrideCache = - WeakCache.memoize<ItemStack, EquipmentSlot, Optional<EquippableComponent>>("ArmorOverrides") { stack, slot -> - val id = stack.skyBlockId ?: return@memoize Optional.empty() - val override = overrides[id.neuItem] ?: return@memoize Optional.empty() + WeakCache.dontMemoize<ItemStack, EquipmentSlot, Optional<EquippableComponent>>("ArmorOverrides") { stack, slot -> + val id = stack.skyBlockId ?: return@dontMemoize Optional.empty() + val override = overrides[id.neuItem] ?: return@dontMemoize Optional.empty() for (suboverride in override.overrides) { if (suboverride.predicate.test(stack)) { - return@memoize resolveComponent(slot, suboverride.modelIdentifier).intoOptional() + return@dontMemoize resolveComponent(slot, suboverride.modelIdentifier).intoOptional() } } - return@memoize resolveComponent(slot, override.modelIdentifier).intoOptional() + return@dontMemoize resolveComponent(slot, override.modelIdentifier).intoOptional() } var overrides: Map<String, ArmorOverride> = mapOf() diff --git a/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt b/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt index bef52d2..cf2a232 100644 --- a/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt +++ b/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt @@ -45,7 +45,7 @@ object CustomSkyBlockTextures : FirmamentFeature { listOf( skullTextureCache.cache, CustomItemModelEvent.cache.cache, - CustomGlobalArmorOverrides.overrideCache.cache + // TODO: re-add this once i figure out how to make the cache useful again CustomGlobalArmorOverrides.overrideCache.cache ) } |