aboutsummaryrefslogtreecommitdiff
path: root/src/texturePacks/java/moe/nea/firmament/features/texturepack/StringMatcher.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-04-01 01:37:55 +0200
committerLinnea Gräf <nea@nea.moe>2025-04-01 01:37:55 +0200
commitbda040c6c2cc77c9c1a06a61b2f13548d28d76ec (patch)
tree3c48dc96cfd74a6a7d167e45eaccca0bec74fb12 /src/texturePacks/java/moe/nea/firmament/features/texturepack/StringMatcher.kt
parent4f4652bb0d50dfd37297a573ad73ef9cd1a8e92d (diff)
downloadFirmament-mc1.21.5.tar.gz
Firmament-mc1.21.5.tar.bz2
Firmament-mc1.21.5.zip
WIP: Port some 1.21.5 thingsmc1.21.5
Diffstat (limited to 'src/texturePacks/java/moe/nea/firmament/features/texturepack/StringMatcher.kt')
-rw-r--r--src/texturePacks/java/moe/nea/firmament/features/texturepack/StringMatcher.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/texturePacks/java/moe/nea/firmament/features/texturepack/StringMatcher.kt b/src/texturePacks/java/moe/nea/firmament/features/texturepack/StringMatcher.kt
index 2b13284..dd28d9f 100644
--- a/src/texturePacks/java/moe/nea/firmament/features/texturepack/StringMatcher.kt
+++ b/src/texturePacks/java/moe/nea/firmament/features/texturepack/StringMatcher.kt
@@ -13,6 +13,7 @@ import kotlinx.serialization.Serializable
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
+import kotlin.jvm.optionals.getOrNull
import net.minecraft.nbt.NbtString
import net.minecraft.text.Text
import moe.nea.firmament.util.MC
@@ -26,7 +27,7 @@ interface StringMatcher {
}
fun matches(nbt: NbtString): Boolean {
- val string = nbt.asString()
+ val string = nbt.value
val jsonStart = string.indexOf('{')
val stringStart = string.indexOf('"')
val isString = stringStart >= 0 && string.subSequence(0, stringStart).isBlank()