From a27f8e6fed4f8f6565e311fe3684beb0377229f7 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Fri, 18 Oct 2024 17:47:32 +0200 Subject: Add super craft to the move item REI button --- src/main/kotlin/util/SkyblockId.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/main/kotlin/util') diff --git a/src/main/kotlin/util/SkyblockId.kt b/src/main/kotlin/util/SkyblockId.kt index 5b96dfa..31227e2 100644 --- a/src/main/kotlin/util/SkyblockId.kt +++ b/src/main/kotlin/util/SkyblockId.kt @@ -13,8 +13,10 @@ import kotlin.jvm.optionals.getOrNull import net.minecraft.component.DataComponentTypes import net.minecraft.component.type.NbtComponent import net.minecraft.item.ItemStack +import net.minecraft.item.Items import net.minecraft.nbt.NbtCompound import net.minecraft.util.Identifier +import moe.nea.firmament.repo.ItemCache.asItemStack import moe.nea.firmament.repo.set import moe.nea.firmament.util.collections.WeakCache import moe.nea.firmament.util.json.DashlessUUIDSerializer @@ -69,6 +71,17 @@ value class SkyblockId(val neuItem: String) { val NEUItem.skyblockId get() = SkyblockId(skyblockItemId) +fun NEUItem.guessRecipeId(): String? { + if (!skyblockItemId.contains(";")) return skyblockItemId + val item = this.asItemStack() + val (id, extraId) = skyblockItemId.split(";") + if (item.item == Items.ENCHANTED_BOOK) { + return "ENCHANTED_BOOK_${id}_${extraId}" + } + if (item.petData != null) return id + return null +} + @Serializable data class HypixelPetInfo( val type: String, -- cgit