Fixed SkullUtils#getSkullTexture

This commit is contained in:
Auxilor
2021-11-01 16:00:38 +00:00
parent d34e43797d
commit e89008cf97
2 changed files with 8 additions and 6 deletions

View File

@@ -36,8 +36,9 @@ class Skull : SkullProxy {
profile = meta.javaClass.getDeclaredField("profile")
profile.isAccessible = true
}
val profile = profile[meta] as GameProfile?
val property = profile?.properties?.get("textures") as Property?
return property?.value
val profile = profile[meta] as GameProfile? ?: return null
val properties = profile.properties ?: return null
val prop = properties["textures"] ?: return null
return prop.toMutableList().firstOrNull()?.name
}
}

View File

@@ -36,8 +36,9 @@ class Skull : SkullProxy {
profile = meta.javaClass.getDeclaredField("profile")
profile.isAccessible = true
}
val profile = profile[meta] as GameProfile?
val property = profile?.properties?.get("textures") as Property?
return property?.value
val profile = profile[meta] as GameProfile? ?: return null
val properties = profile.properties ?: return null
val prop = properties["textures"] ?: return null
return prop.toMutableList().firstOrNull()?.name
}
}