aboutsummaryrefslogtreecommitdiff
path: root/src/texturePacks/java/moe/nea/firmament/features/texturepack/predicates
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-11-15 23:42:26 +0100
committerLinnea Gräf <nea@nea.moe>2025-11-15 23:42:26 +0100
commit5632c1d50bb0319886fb6acd54df92bf01491532 (patch)
tree6f9adb070df25a4406cfa7713714f9e348f7445e /src/texturePacks/java/moe/nea/firmament/features/texturepack/predicates
parent4d8399ff4d769def62e6a8241327c4f2dac47e71 (diff)
downloadFirmament-5632c1d50bb0319886fb6acd54df92bf01491532.tar.gz
Firmament-5632c1d50bb0319886fb6acd54df92bf01491532.tar.bz2
Firmament-5632c1d50bb0319886fb6acd54df92bf01491532.zip
snapshot: full 1.21.10 build (- REI; fuck private discord builds)
Diffstat (limited to 'src/texturePacks/java/moe/nea/firmament/features/texturepack/predicates')
-rw-r--r--src/texturePacks/java/moe/nea/firmament/features/texturepack/predicates/GenericComponentPredicate.kt3
-rw-r--r--src/texturePacks/java/moe/nea/firmament/features/texturepack/predicates/SkullPredicate.kt4
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