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/BrokenHyp.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/BrokenHyp.kt')
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/features/BrokenHyp.kt | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/features/BrokenHyp.kt b/src/main/kotlin/com/dulkirfabric/features/BrokenHyp.kt index 85c1f7b..713a9d1 100644 --- a/src/main/kotlin/com/dulkirfabric/features/BrokenHyp.kt +++ b/src/main/kotlin/com/dulkirfabric/features/BrokenHyp.kt @@ -6,6 +6,7 @@ import com.dulkirfabric.events.LongUpdateEvent import com.dulkirfabric.util.TablistUtils import com.dulkirfabric.util.render.HudRenderUtil import meteordevelopment.orbit.EventHandler +import net.minecraft.component.DataComponentTypes import net.minecraft.item.ItemStack import net.minecraft.text.Style import net.minecraft.text.Text @@ -29,11 +30,11 @@ object BrokenHyp { val stack: ItemStack = mc.player?.mainHandStack ?: return // get info about held item - val tag = stack.nbt ?: return - id = tag.getCompound("ExtraAttributes")?.getString("id") ?: "" + val tag = stack.get(DataComponentTypes.CUSTOM_DATA)?.nbt ?: return + id = tag.getString("id") ?: "" - kill = tag.getCompound("ExtraAttributes")?.getInt("stats_book") ?: -1 - championXp = tag.getCompound("ExtraAttributes")?.getDouble("champion_combat_xp") ?: -1.0 + kill = tag.getInt("stats_book") ?: -1 + championXp = tag.getDouble("champion_combat_xp") ?: -1.0 // check if a wither blade, then check if same id if (!(id matches "(HYPERION|ASTRAEA|SCYLLA|VALKYRIE)".toRegex())) { |