aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/moe/nea/firmament/util/LegacyTagParser.kt8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/util/LegacyTagParser.kt b/src/main/kotlin/moe/nea/firmament/util/LegacyTagParser.kt
index 80e1ea4..47d60ac 100644
--- a/src/main/kotlin/moe/nea/firmament/util/LegacyTagParser.kt
+++ b/src/main/kotlin/moe/nea/firmament/util/LegacyTagParser.kt
@@ -208,10 +208,6 @@ class LegacyTagParser private constructor(string: String) {
if (textForm.isEmpty()) {
racer.error("Expected numeric tag (starting with either -, +, . or a digit")
}
- val doubleMatch = Patterns.DOUBLE.matchEntire(textForm) ?: Patterns.DOUBLE_UNTYPED.matchEntire(textForm)
- if (doubleMatch != null) {
- return NbtDouble.of(doubleMatch.groups[1]!!.value.toDouble())
- }
val floatMatch = Patterns.FLOAT.matchEntire(textForm)
if (floatMatch != null) {
return NbtFloat.of(floatMatch.groups[1]!!.value.toFloat())
@@ -232,6 +228,10 @@ class LegacyTagParser private constructor(string: String) {
if (integerMatch != null) {
return NbtInt.of(integerMatch.groups[1]!!.value.toInt())
}
+ val doubleMatch = Patterns.DOUBLE.matchEntire(textForm) ?: Patterns.DOUBLE_UNTYPED.matchEntire(textForm)
+ if (doubleMatch != null) {
+ return NbtDouble.of(doubleMatch.groups[1]!!.value.toDouble())
+ }
throw IllegalStateException("Could not properly parse numeric tag '$textForm', despite passing rough verification. This is a bug in the LegacyTagParser")
}