From 7bc18b6c54c7a772d058139243f64321ec0d592c Mon Sep 17 00:00:00 2001 From: Boy Date: Sat, 10 Aug 2024 01:14:39 +0200 Subject: [PATCH] fix: parent-models not being properly obfuscated --- src/main/kotlin/com/mineinabyss/packy/PackObfuscator.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/com/mineinabyss/packy/PackObfuscator.kt b/src/main/kotlin/com/mineinabyss/packy/PackObfuscator.kt index 2fd0875..eb1030a 100644 --- a/src/main/kotlin/com/mineinabyss/packy/PackObfuscator.kt +++ b/src/main/kotlin/com/mineinabyss/packy/PackObfuscator.kt @@ -188,12 +188,8 @@ class PackObfuscator(private val resourcePack: ResourcePack) { ?: toBuilder().overrides(overrides().filterNotNull().map { override -> val overrideKey = override.model() val modelKey = obfuscatedModels.findObf(overrideKey)?.key() - ?: resourcePack.takeUnless { - overrideKey == this.key() || ResourcePacks.defaultVanillaResourcePack?.model( - overrideKey - ) != null - } - ?.model(overrideKey)?.let(::obfuscateModel)?.key() + ?: ResourcePacks.defaultVanillaResourcePack?.model(overrideKey)?.let { overrideKey } + ?: resourcePack.takeUnless { overrideKey == this.key() }?.model(overrideKey)?.let(::obfuscateModel)?.key() ?: overrideKey return@map ItemOverride.of(modelKey, override.predicate())