diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-20 01:37:48 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-20 01:37:48 +0100 |
commit | 0b897aeae566b19e9bf87776156d761965f7d1ec (patch) | |
tree | 66141b95abf1afed3af76ada530743ca36d71600 /src/main/java/at/hannibal2/skyhanni | |
parent | 35b6ecbdcb5e8e7ed0ef15abec7d86da6c82d728 (diff) | |
download | skyhanni-0b897aeae566b19e9bf87776156d761965f7d1ec.tar.gz skyhanni-0b897aeae566b19e9bf87776156d761965f7d1ec.tar.bz2 skyhanni-0b897aeae566b19e9bf87776156d761965f7d1ec.zip |
Fixed /ff upgrade suggests to update bustling reforge even when no farming armor is found.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt | 14 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt index 932fbbacd..d93dfd36a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt @@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.features.garden.fortuneguide.pages.CropPage import at.hannibal2.skyhanni.features.garden.fortuneguide.pages.OverviewPage import at.hannibal2.skyhanni.features.garden.fortuneguide.pages.UpgradePage import at.hannibal2.skyhanni.utils.GuiRenderUtils +import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.SoundUtils import net.minecraft.client.Minecraft import net.minecraft.client.gui.GuiScreen @@ -56,8 +57,14 @@ open class FFGuideGUI : GuiScreen() { return fallbackItem } - fun getFallbackItem(item: FarmingItems): ItemStack = - ItemStack(Blocks.barrier).setStackDisplayName("§cNo saved ${item.name.lowercase().replace("_", " ")}") + private val fallbackItems = mutableMapOf<FarmingItems, ItemStack>() + + fun getFallbackItem(item: FarmingItems) = fallbackItems.getOrPut(item) { + val name = "§cNo saved ${item.name.lowercase().replace("_", " ")}" + ItemStack(Blocks.barrier).setStackDisplayName(name) + } + + fun isFallbackItem(item: ItemStack) = item.name!!.startsWith("§cNo saved ") } init { @@ -294,7 +301,8 @@ open class FFGuideGUI : GuiScreen() { x = guiLeft - 28 y = guiTop + 15 if (isMouseIn(x, y, 28, 25) && - selectedPage != FortuneGuidePage.CROP && selectedPage != FortuneGuidePage.OVERVIEW) { + selectedPage != FortuneGuidePage.CROP && selectedPage != FortuneGuidePage.OVERVIEW + ) { SoundUtils.playClickSound() selectedPage = if (currentCrop == null) { FortuneGuidePage.OVERVIEW diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt index 9b2f6441e..c7ff7275a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt @@ -126,6 +126,8 @@ object FortuneUpgrades { val item = piece.getItem() //todo skip if it doesnt exist -> tell them to buy it later + if (FFGuideGUI.isFallbackItem(item)) return + recombobulateItem(item, genericUpgrades) when (item.getReforgeName()) { "mossy" -> {} |