aboutsummaryrefslogtreecommitdiff
path: root/src/texturePacks/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/texturePacks/java')
-rw-r--r--src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomGlobalArmorOverrides.kt13
-rw-r--r--src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt2
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
)
}