diff --git a/eco-core/core-nms/v1_17_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_17_R1/Skull.kt b/eco-core/core-nms/v1_17_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_17_R1/Skull.kt index 6dc7673a..894a5060 100644 --- a/eco-core/core-nms/v1_17_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_17_R1/Skull.kt +++ b/eco-core/core-nms/v1_17_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_17_R1/Skull.kt @@ -20,6 +20,10 @@ class Skull : SkullProxy { setProfile = meta.javaClass.getDeclaredMethod("setProfile", GameProfile::class.java) setProfile.isAccessible = true } + if (base64.length < 20) { + return + } + val uuid = UUID( base64.substring(base64.length - 20).hashCode().toLong(), base64.substring(base64.length - 10).hashCode().toLong() @@ -39,6 +43,6 @@ class Skull : SkullProxy { val profile = profile[meta] as GameProfile? ?: return null val properties = profile.properties ?: return null val prop = properties["textures"] ?: return null - return prop.toMutableList().firstOrNull()?.value + return prop.toMutableList().firstOrNull()?.name } } \ No newline at end of file diff --git a/eco-core/core-nms/v1_18_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_18_R1/Skull.kt b/eco-core/core-nms/v1_18_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_18_R1/Skull.kt index 80a28f22..5dd50b39 100644 --- a/eco-core/core-nms/v1_18_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_18_R1/Skull.kt +++ b/eco-core/core-nms/v1_18_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_18_R1/Skull.kt @@ -20,6 +20,10 @@ class Skull : SkullProxy { setProfile = meta.javaClass.getDeclaredMethod("setProfile", GameProfile::class.java) setProfile.isAccessible = true } + if (base64.length < 20) { + return + } + val uuid = UUID( base64.substring(base64.length - 20).hashCode().toLong(), base64.substring(base64.length - 10).hashCode().toLong() @@ -39,6 +43,6 @@ class Skull : SkullProxy { val profile = profile[meta] as GameProfile? ?: return null val properties = profile.properties ?: return null val prop = properties["textures"] ?: return null - return prop.toMutableList().firstOrNull()?.value + return prop.toMutableList().firstOrNull()?.name } } \ No newline at end of file diff --git a/eco-core/core-nms/v1_18_R2/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_18_R2/Skull.kt b/eco-core/core-nms/v1_18_R2/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_18_R2/Skull.kt index d4c6510f..7e553165 100644 --- a/eco-core/core-nms/v1_18_R2/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_18_R2/Skull.kt +++ b/eco-core/core-nms/v1_18_R2/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_18_R2/Skull.kt @@ -20,6 +20,10 @@ class Skull : SkullProxy { setProfile = meta.javaClass.getDeclaredMethod("setProfile", GameProfile::class.java) setProfile.isAccessible = true } + if (base64.length < 20) { + return + } + val uuid = UUID( base64.substring(base64.length - 20).hashCode().toLong(), base64.substring(base64.length - 10).hashCode().toLong() @@ -39,6 +43,6 @@ class Skull : SkullProxy { val profile = profile[meta] as GameProfile? ?: return null val properties = profile.properties ?: return null val prop = properties["textures"] ?: return null - return prop.toMutableList().firstOrNull()?.value + return prop.toMutableList().firstOrNull()?.name } } \ No newline at end of file