diff options
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/util')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/MC.kt | 1 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/SkyblockId.kt | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/util/MC.kt b/src/main/kotlin/moe/nea/firmament/util/MC.kt index 0c09306..e8611a6 100644 --- a/src/main/kotlin/moe/nea/firmament/util/MC.kt +++ b/src/main/kotlin/moe/nea/firmament/util/MC.kt @@ -13,6 +13,7 @@ import net.minecraft.client.gui.screen.ingame.HandledScreen import net.minecraft.text.Text import net.minecraft.util.math.BlockPos import moe.nea.firmament.events.TickEvent +import moe.nea.firmament.mixins.accessor.AccessorHandledScreen object MC { diff --git a/src/main/kotlin/moe/nea/firmament/util/SkyblockId.kt b/src/main/kotlin/moe/nea/firmament/util/SkyblockId.kt index fe2b4e5..a071107 100644 --- a/src/main/kotlin/moe/nea/firmament/util/SkyblockId.kt +++ b/src/main/kotlin/moe/nea/firmament/util/SkyblockId.kt @@ -5,11 +5,12 @@ */ @file:UseSerializers(DashlessUUIDSerializer::class) + package moe.nea.firmament.util import io.github.moulberry.repo.data.NEUItem import io.github.moulberry.repo.data.Rarity -import java.util.UUID +import java.util.* import kotlinx.serialization.Serializable import kotlinx.serialization.UseSerializers import kotlinx.serialization.decodeFromString @@ -73,6 +74,12 @@ private val jsonparser = Json { ignoreUnknownKeys = true } val ItemStack.extraAttributes: NbtCompound get() = getOrCreateSubNbt("ExtraAttributes") +val ItemStack.skyblockUUIDString: String? + get() = extraAttributes.getString("uuid")?.takeIf { it.isNotBlank() } + +val ItemStack.skyblockUUID: UUID? + get() = skyblockUUIDString?.let { UUID.fromString(it) } + val ItemStack.petData: HypixelPetInfo? get() { val jsonString = extraAttributes.getString("petInfo") |