diff options
Diffstat (limited to 'src/texturePacks/java/moe/nea/firmament/features/texturepack/predicates')
2 files changed, 4 insertions, 3 deletions
diff --git a/src/texturePacks/java/moe/nea/firmament/features/texturepack/predicates/GenericComponentPredicate.kt b/src/texturePacks/java/moe/nea/firmament/features/texturepack/predicates/GenericComponentPredicate.kt index 71392ef..74fd0d6 100644 --- a/src/texturePacks/java/moe/nea/firmament/features/texturepack/predicates/GenericComponentPredicate.kt +++ b/src/texturePacks/java/moe/nea/firmament/features/texturepack/predicates/GenericComponentPredicate.kt @@ -16,6 +16,7 @@ import moe.nea.firmament.features.texturepack.FirmamentModelPredicate import moe.nea.firmament.features.texturepack.FirmamentModelPredicateParser import moe.nea.firmament.util.MC import moe.nea.firmament.util.mc.NbtPrism +import moe.nea.firmament.util.mc.unsafeNbt data class GenericComponentPredicate<T>( val componentType: ComponentType<T>, @@ -30,7 +31,7 @@ data class GenericComponentPredicate<T>( val component = stack.get(componentType) ?: return false // TODO: cache this val nbt = - if (component is NbtComponent) component.nbt + if (component is NbtComponent) component.unsafeNbt else codec.encodeStart(NbtOps.INSTANCE, component) .resultOrPartial().getOrNull() ?: return false return path.access(nbt).any { matcher.matches(it) } diff --git a/src/texturePacks/java/moe/nea/firmament/features/texturepack/predicates/SkullPredicate.kt b/src/texturePacks/java/moe/nea/firmament/features/texturepack/predicates/SkullPredicate.kt index f17582d..935fe7a 100644 --- a/src/texturePacks/java/moe/nea/firmament/features/texturepack/predicates/SkullPredicate.kt +++ b/src/texturePacks/java/moe/nea/firmament/features/texturepack/predicates/SkullPredicate.kt @@ -36,13 +36,13 @@ class SkullPredicate( override fun test(stack: ItemStack, holder: LivingEntity?): Boolean { if (!stack.isOf(Items.PLAYER_HEAD)) return false val profile = stack.get(DataComponentTypes.PROFILE) ?: return false - val textureProperty = profile.properties["textures"].firstOrNull() + val textureProperty = profile.gameProfile.properties["textures"].firstOrNull() val textureMode = lazy(LazyThreadSafetyMode.NONE) { decodeProfileTextureProperty(textureProperty ?: return@lazy null) } when { profileId != null - && profileId != profile.uuid.getOrNull() -> + && profileId != profile.gameProfile.id -> return false textureValue != null |
