From 48f26364f0572793f38f32a94697e1154447fcfc Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 30 Jun 2024 06:49:41 -0400 Subject: Feature: Add Recipe Link to Shopping List Craftable! text (#2075) Co-authored-by: Luna --- .../features/garden/visitor/GardenVisitorFeatures.kt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt index 4d7c45cd0..2df429c7b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt @@ -30,6 +30,7 @@ import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.ConfigUtils import at.hannibal2.skyhanni.utils.EntityUtils +import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.InventoryUtils.getAmountInInventory import at.hannibal2.skyhanni.utils.ItemBlink import at.hannibal2.skyhanni.utils.ItemUtils @@ -253,7 +254,21 @@ object GardenVisitorFeatures { } } if (hasIngredients) { - list.add(" §7(§aCraftable!§7)") + val leftToCraft = amount - amountInSacks + list.add(" §7(") + list.add( + Renderable.optionalLink( + "§aCraftable!", + { + if (Minecraft.getMinecraft().currentScreen is GuiEditSign) { + LorenzUtils.setTextIntoSign("$leftToCraft") + } else { + HypixelCommands.viewRecipe(internalName.toString()) + } + }, + ) { GardenAPI.inGarden() && !NEUItems.neuHasFocus() }, + ) + list.add("§7)") } } -- cgit