diff options
author | Linnea Gräf <nea@nea.moe> | 2024-05-09 22:12:27 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-05-09 22:12:27 +0200 |
commit | dce5a156849a3ba1b09e28dbfc153fc14a7f7b2c (patch) | |
tree | b51bffce829a14ed1bdccb581acec2dd1838540e /src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt | |
parent | 9d2b7bec68f98228acf913f029f0383e4dcff3d7 (diff) | |
download | DulkirMod-Fabric-dce5a156849a3ba1b09e28dbfc153fc14a7f7b2c.tar.gz DulkirMod-Fabric-dce5a156849a3ba1b09e28dbfc153fc14a7f7b2c.tar.bz2 DulkirMod-Fabric-dce5a156849a3ba1b09e28dbfc153fc14a7f7b2c.zip |
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt')
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt b/src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt index 0476d51..e562a2e 100644 --- a/src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt +++ b/src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt @@ -8,6 +8,7 @@ import com.dulkirfabric.util.TrackedCooldown import com.dulkirfabric.util.Utils import meteordevelopment.orbit.EventHandler import net.minecraft.client.sound.Sound +import net.minecraft.component.DataComponentTypes import net.minecraft.item.ItemStack import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable import kotlin.math.round @@ -89,8 +90,8 @@ object CooldownDisplays { } private fun fetchCooldownItem(stack: ItemStack): TrackedCooldown? { - val tag = stack.nbt ?: return null - val id = tag.getCompound("ExtraAttributes").get("id") ?: return null + val tag = stack.get(DataComponentTypes.CUSTOM_DATA)?.nbt ?: return null + val id = tag.get("id") ?: return null val idStr = id.toString().trim('"') trackedCooldowns.forEach { if (idStr matches it.value.itemID) |