From dce5a156849a3ba1b09e28dbfc153fc14a7f7b2c Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Thu, 9 May 2024 22:12:27 +0200 Subject: Port to 1.20.6 --- src/main/kotlin/com/dulkirfabric/util/Utils.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin/com/dulkirfabric/util/Utils.kt') diff --git a/src/main/kotlin/com/dulkirfabric/util/Utils.kt b/src/main/kotlin/com/dulkirfabric/util/Utils.kt index 342dc48..e6342cb 100644 --- a/src/main/kotlin/com/dulkirfabric/util/Utils.kt +++ b/src/main/kotlin/com/dulkirfabric/util/Utils.kt @@ -6,6 +6,7 @@ import com.dulkirfabric.events.WorldLoadEvent import com.dulkirfabric.events.chat.ChatEvents import meteordevelopment.orbit.EventHandler import net.minecraft.block.entity.SkullBlockEntity +import net.minecraft.component.DataComponentTypes import net.minecraft.entity.Entity import net.minecraft.item.ItemStack import net.minecraft.nbt.NbtHelper @@ -72,7 +73,7 @@ object Utils { } fun getSkullTexture(itemStack: ItemStack): String? { - return itemStack.getSubNbt(SkullBlockEntity.SKULL_OWNER_KEY)?.let(NbtHelper::toGameProfile)?.properties?.get( + return itemStack.get(DataComponentTypes.PROFILE)?.properties?.get( "textures")?.first()?.value } } \ No newline at end of file -- cgit