Skip to content

Commit 08c07cf

Browse files
committed
Update DynamicReflectionSerializer.kt
1 parent 31d338d commit 08c07cf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

common/src/main/kotlin/com/lambda/util/DynamicReflectionSerializer.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ object DynamicReflectionSerializer : Loadable {
7979
failure = { LOG.error("Could not download the required files for the dynamic remapper") }
8080
).join()
8181
}.let { file ->
82+
if (!file.exists()) emptyMap<String, String>()
8283
file.readLines()
8384
.map { it.split('\t') }
8485
.associate { it[0].split('$').last() to it[1] }
@@ -138,9 +139,9 @@ object DynamicReflectionSerializer : Loadable {
138139
if (currentDepth < maxRecursionDepth
139140
&& fieldValue != null
140141
&& !field.type.isPrimitive
141-
&& !field.type.isArray &&
142-
!field.type.isEnum &&
143-
skipables.none { it.isAssignableFrom(field.type) }
142+
&& !field.type.isArray
143+
&& !field.type.isEnum
144+
&& skipables.none { it.isAssignableFrom(field.type) }
144145
) {
145146
fieldValue.dynamicString(
146147
maxRecursionDepth,
@@ -170,7 +171,7 @@ object DynamicReflectionSerializer : Loadable {
170171
is RegistryEntry<*> -> "${value()}"
171172
else -> {
172173
if (this?.javaClass?.canonicalName?.contains("minecraft") == true)
173-
"${this.javaClass.dynamicName(remap).substringAfterLast('.')}@${Integer.toHexString(hashCode())}"
174+
"${this.javaClass.dynamicName(remap)}@${Integer.toHexString(hashCode())}"
174175
else this?.toString() ?: "null"
175176
}
176177
}

0 commit comments

Comments
 (0)