From 93af7607b3d5c1061bc845f097fe8be94c5e2043 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Fri, 1 Mar 2024 17:14:54 +0100 Subject: Internal Change: Bazaar Config -> Inventory Config (#1082) --- src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt | 10 +- .../at/hannibal2/skyhanni/config/Features.java | 5 - .../config/features/bazaar/BazaarConfig.java | 52 ------- .../config/features/inventory/BazaarConfig.java | 52 +++++++ .../config/features/inventory/InventoryConfig.java | 4 + .../skyhanni/features/bazaar/BazaarApi.kt | 150 -------------------- .../features/bazaar/BazaarBestSellMethod.kt | 80 ----------- .../bazaar/BazaarCancelledBuyOrderClipboard.kt | 60 -------- .../skyhanni/features/bazaar/BazaarData.kt | 7 - .../skyhanni/features/bazaar/BazaarDataHolder.kt | 78 ----------- .../features/bazaar/BazaarOpenPriceWebsite.kt | 66 --------- .../skyhanni/features/bazaar/BazaarOrderHelper.kt | 92 ------------ .../features/combat/ghostcounter/GhostCounter.kt | 2 +- .../skyhanni/features/fame/CityProjectFeatures.kt | 2 +- .../features/garden/composter/ComposterOverlay.kt | 2 +- .../features/garden/farming/CropMoneyDisplay.kt | 6 +- .../garden/fortuneguide/pages/UpgradePage.kt | 2 +- .../garden/visitor/GardenVisitorFeatures.kt | 2 +- .../features/inventory/HideNotClickableItems.kt | 2 +- .../skyhanni/features/inventory/MaxPurseItems.kt | 4 +- .../features/inventory/PowerStoneGuideFeatures.kt | 2 +- .../skyhanni/features/inventory/SackDisplay.kt | 2 +- .../features/inventory/bazaar/BazaarApi.kt | 156 +++++++++++++++++++++ .../inventory/bazaar/BazaarBestSellMethod.kt | 81 +++++++++++ .../bazaar/BazaarCancelledBuyOrderClipboard.kt | 60 ++++++++ .../features/inventory/bazaar/BazaarData.kt | 7 + .../features/inventory/bazaar/BazaarDataHolder.kt | 78 +++++++++++ .../inventory/bazaar/BazaarOpenPriceWebsite.kt | 66 +++++++++ .../features/inventory/bazaar/BazaarOrderHelper.kt | 92 ++++++++++++ .../java/at/hannibal2/skyhanni/utils/NEUItems.kt | 2 +- .../skyhanni/utils/tracker/SkyHanniTracker.kt | 2 +- 31 files changed, 616 insertions(+), 610 deletions(-) delete mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/bazaar/BazaarConfig.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/inventory/BazaarConfig.java delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarCancelledBuyOrderClipboard.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarData.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOpenPriceWebsite.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarBestSellMethod.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarCancelledBuyOrderClipboard.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarData.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarDataHolder.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOpenPriceWebsite.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOrderHelper.kt (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 4037f11ff..f67082a36 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -54,11 +54,6 @@ import at.hannibal2.skyhanni.data.repo.RepoManager import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.PreInitFinishedEvent import at.hannibal2.skyhanni.features.anvil.AnvilCombineHelper -import at.hannibal2.skyhanni.features.bazaar.BazaarApi -import at.hannibal2.skyhanni.features.bazaar.BazaarBestSellMethod -import at.hannibal2.skyhanni.features.bazaar.BazaarCancelledBuyOrderClipboard -import at.hannibal2.skyhanni.features.bazaar.BazaarOpenPriceWebsite -import at.hannibal2.skyhanni.features.bazaar.BazaarOrderHelper import at.hannibal2.skyhanni.features.bingo.BingoAPI import at.hannibal2.skyhanni.features.bingo.CompactBingoChat import at.hannibal2.skyhanni.features.bingo.MinionCraftHelper @@ -227,6 +222,11 @@ import at.hannibal2.skyhanni.features.inventory.ShiftClickEquipment import at.hannibal2.skyhanni.features.inventory.ShiftClickNPCSell import at.hannibal2.skyhanni.features.inventory.SkyblockGuideHighlightFeature import at.hannibal2.skyhanni.features.inventory.StatsTuning +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarBestSellMethod +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarCancelledBuyOrderClipboard +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarOpenPriceWebsite +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarOrderHelper import at.hannibal2.skyhanni.features.inventory.tiarelay.TiaRelayHelper import at.hannibal2.skyhanni.features.inventory.tiarelay.TiaRelayWaypoints import at.hannibal2.skyhanni.features.itemabilities.ChickenHeadTimer diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java index af464f366..c4bd8bbe4 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Features.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java @@ -2,7 +2,6 @@ package at.hannibal2.skyhanni.config; import at.hannibal2.skyhanni.SkyHanniMod; import at.hannibal2.skyhanni.config.features.About; -import at.hannibal2.skyhanni.config.features.bazaar.BazaarConfig; import at.hannibal2.skyhanni.config.features.chat.ChatConfig; import at.hannibal2.skyhanni.config.features.chroma.ChromaConfig; import at.hannibal2.skyhanni.config.features.combat.CombatConfig; @@ -77,10 +76,6 @@ public class Features extends Config { @Category(name = "GUI", desc = "Change the locations of GUI elements (§e/sh gui§7).") public GUIConfig gui = new GUIConfig(); - @Expose - @Category(name = "Bazaar", desc = "Bazaar settings.") - public BazaarConfig bazaar = new BazaarConfig(); - @Expose @Category(name = "Chat", desc = "Change how the chat looks.") public ChatConfig chat = new ChatConfig(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/bazaar/BazaarConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/bazaar/BazaarConfig.java deleted file mode 100644 index cdac05e02..000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/bazaar/BazaarConfig.java +++ /dev/null @@ -1,52 +0,0 @@ -package at.hannibal2.skyhanni.config.features.bazaar; - -import at.hannibal2.skyhanni.config.FeatureToggle; -import at.hannibal2.skyhanni.config.core.config.Position; -import com.google.gson.annotations.Expose; -import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; -import io.github.moulberry.moulconfig.annotations.ConfigOption; - -public class BazaarConfig { - - @Expose - @ConfigOption(name = "Purchase Helper", desc = "Highlights the item you are trying to buy in the Bazaar.") - @ConfigEditorBoolean - @FeatureToggle - public boolean purchaseHelper = true; - - @Expose - @ConfigOption(name = "Order Helper", desc = "Show visual hints inside the Bazaar Manage Order view when items are ready to pickup or outbid.") - @ConfigEditorBoolean - @FeatureToggle - public boolean orderHelper = false; - - @Expose - @ConfigOption(name = "Best Sell Method", desc = "Show the price difference between sell instantly and sell offer.") - @ConfigEditorBoolean - @FeatureToggle - public boolean bestSellMethod = false; - - @Expose - public Position bestSellMethodPos = new Position(394, 142, false, true); - - @Expose - @ConfigOption(name = "Cancelled Buy Order Clipboard", desc = "Saves missing items from cancelled buy orders to clipboard for faster re-entry.") - @ConfigEditorBoolean - @FeatureToggle - public boolean cancelledBuyOrderClipboard = false; - - @Expose - @ConfigOption(name = "Price Website", desc = "Adds a button to the Bazaar product inventory that will open the item page in §cskyblock.bz§7.") - @ConfigEditorBoolean - @FeatureToggle - public boolean openPriceWebsite = false; - - @Expose - @ConfigOption(name = "Max Items With Purse", desc = "Calculates the maximum amount of items that can be purchased from the Bazaar with the amount of coins in your purse.") - @ConfigEditorBoolean - @FeatureToggle - public boolean maxPurseItems = false; - - @Expose - public Position maxPurseItemsPosition = new Position(346, 90, true, false); -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/BazaarConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/BazaarConfig.java new file mode 100644 index 000000000..418d629dc --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/BazaarConfig.java @@ -0,0 +1,52 @@ +package at.hannibal2.skyhanni.config.features.inventory; + +import at.hannibal2.skyhanni.config.FeatureToggle; +import at.hannibal2.skyhanni.config.core.config.Position; +import com.google.gson.annotations.Expose; +import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; +import io.github.moulberry.moulconfig.annotations.ConfigOption; + +public class BazaarConfig { + + @Expose + @ConfigOption(name = "Purchase Helper", desc = "Highlights the item you are trying to buy in the Bazaar.") + @ConfigEditorBoolean + @FeatureToggle + public boolean purchaseHelper = true; + + @Expose + @ConfigOption(name = "Order Helper", desc = "Show visual hints inside the Bazaar Manage Order view when items are ready to pickup or outbid.") + @ConfigEditorBoolean + @FeatureToggle + public boolean orderHelper = false; + + @Expose + @ConfigOption(name = "Best Sell Method", desc = "Show the price difference between sell instantly and sell offer.") + @ConfigEditorBoolean + @FeatureToggle + public boolean bestSellMethod = false; + + @Expose + public Position bestSellMethodPos = new Position(394, 142, false, true); + + @Expose + @ConfigOption(name = "Cancelled Buy Order Clipboard", desc = "Saves missing items from cancelled buy orders to clipboard for faster re-entry.") + @ConfigEditorBoolean + @FeatureToggle + public boolean cancelledBuyOrderClipboard = false; + + @Expose + @ConfigOption(name = "Price Website", desc = "Adds a button to the Bazaar product inventory that will open the item page in §cskyblock.bz§7.") + @ConfigEditorBoolean + @FeatureToggle + public boolean openPriceWebsite = false; + + @Expose + @ConfigOption(name = "Max Items With Purse", desc = "Calculates the maximum amount of items that can be purchased from the Bazaar with the amount of coins in your purse.") + @ConfigEditorBoolean + @FeatureToggle + public boolean maxPurseItems = false; + + @Expose + public Position maxPurseItemsPosition = new Position(346, 90, true, false); +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java index 553d58214..172907150 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java @@ -56,6 +56,10 @@ public class InventoryConfig { @Category(name = "Skyblock Guide", desc = "") public SkyblockGuideConfig skyblockGuideConfig = new SkyblockGuideConfig(); + @Expose + @Category(name = "Bazaar", desc = "Bazaar settings.") + public BazaarConfig bazaar = new BazaarConfig(); + @Expose @Category(name = "Helpers", desc = "Settings for Helpers") public HelperConfig helper = new HelperConfig(); diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt deleted file mode 100644 index 3ec2630a0..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt +++ /dev/null @@ -1,150 +0,0 @@ -package at.hannibal2.skyhanni.features.bazaar - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.BazaarOpenedProductEvent -import at.hannibal2.skyhanni.events.GuiContainerEvent -import at.hannibal2.skyhanni.events.InventoryCloseEvent -import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent -import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.ItemUtils.getLore -import at.hannibal2.skyhanni.utils.ItemUtils.name -import at.hannibal2.skyhanni.utils.LorenzColor -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.NEUInternalName -import at.hannibal2.skyhanni.utils.NEUItems -import at.hannibal2.skyhanni.utils.OSUtils -import at.hannibal2.skyhanni.utils.RenderUtils.highlight -import at.hannibal2.skyhanni.utils.StringUtils.equalsIgnoreColor -import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher -import at.hannibal2.skyhanni.utils.StringUtils.removeColor -import net.minecraft.client.gui.inventory.GuiChest -import net.minecraft.inventory.ContainerChest -import net.minecraft.item.ItemStack -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class BazaarApi { - - private var loadedNpcPriceData = false - - companion object { - - val holder = BazaarDataHolder() - var inBazaarInventory = false - private var currentSearchedItem = "" - - var currentlyOpenedProduct: NEUInternalName? = null - - fun getBazaarDataByName(name: String): BazaarData? = NEUItems.getInternalNameOrNull(name)?.getBazaarData() - - fun NEUInternalName.getBazaarData() = if (isBazaarItem()) { - holder.getData(this) - } else null - - fun isBazaarItem(stack: ItemStack): Boolean = stack.getInternalName().isBazaarItem() - - fun NEUInternalName.isBazaarItem() = NEUItems.manager.auctionManager.getBazaarInfo(asString()) != null - - fun searchForBazaarItem(displayName: String, amount: Int = -1) { - if (!LorenzUtils.inSkyBlock) return - if (NEUItems.neuHasFocus()) return - if (LorenzUtils.noTradeMode) return - if (LorenzUtils.inDungeons || LorenzUtils.inKuudraFight) return - ChatUtils.sendCommandToServer("bz ${displayName.removeColor()}") - if (amount != -1) OSUtils.copyToClipboard(amount.toString()) - currentSearchedItem = displayName.removeColor() - } - } - - @SubscribeEvent - fun onInventoryOpen(event: InventoryFullyOpenedEvent) { - inBazaarInventory = checkIfInBazaar(event) - if (inBazaarInventory) { - val itemName = getOpenedProduct(event.inventoryItems) ?: return - val openedProduct = NEUItems.getInternalNameOrNull(itemName) - currentlyOpenedProduct = openedProduct - BazaarOpenedProductEvent(openedProduct, event).postAndCatch() - } - } - - private fun getOpenedProduct(inventoryItems: Map): String? { - val buyInstantly = inventoryItems[10] ?: return null - - if (buyInstantly.displayName != "§aBuy Instantly") return null - val bazaarItem = inventoryItems[13] ?: return null - - return bazaarItem.displayName - } - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - - if (!loadedNpcPriceData) { - loadedNpcPriceData = true - holder.start() - } - } - - @SubscribeEvent - fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!LorenzUtils.inSkyBlock) return - if (!inBazaarInventory) return - if (!SkyHanniMod.feature.bazaar.purchaseHelper) return - if (currentSearchedItem == "") return - - if (event.gui !is GuiChest) return - val guiChest = event.gui - val chest = guiChest.inventorySlots as ContainerChest - - for (slot in chest.inventorySlots) { - if (slot == null) continue - val stack = slot.stack ?: continue - - if (chest.inventorySlots.indexOf(slot) !in 9..44) { - continue - } - - if (stack.displayName.removeColor() == currentSearchedItem) { - slot highlight LorenzColor.GREEN - } - } - } - - @SubscribeEvent - fun onChat(event: LorenzChatEvent) { - if (!LorenzUtils.inSkyBlock) return - if (!inBazaarInventory) return - // TODO USE SH-REPO - // TODO remove dynamic pattern - "\\[Bazaar] (Buy Order Setup!|Bought).*$currentSearchedItem.*".toPattern() - .matchMatcher(event.message.removeColor()) { currentSearchedItem = "" } - } - - private fun checkIfInBazaar(event: InventoryFullyOpenedEvent): Boolean { - val items = event.inventorySize.let { listOf(it - 5, it - 6) }.mapNotNull { event.inventoryItems[it] } - if (items.any { it.name.equalsIgnoreColor("Go Back") && it.getLore().firstOrNull() == "§7To Bazaar" }) { - return true - } - - if (event.inventoryName.startsWith("Bazaar ➜ ")) return true - return when (event.inventoryName) { - "How many do you want?" -> true - "How much do you want to pay?" -> true - "Confirm Buy Order" -> true - "Confirm Instant Buy" -> true - "At what price are you selling?" -> true - "Confirm Sell Offer" -> true - "Order options" -> true - - else -> false - } - } - - @SubscribeEvent - fun onInventoryClose(event: InventoryCloseEvent) { - inBazaarInventory = false - currentlyOpenedProduct = null - } -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt deleted file mode 100644 index 3e409b0c6..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt +++ /dev/null @@ -1,80 +0,0 @@ -package at.hannibal2.skyhanni.features.bazaar - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.BazaarOpenedProductEvent -import at.hannibal2.skyhanni.events.InventoryCloseEvent -import at.hannibal2.skyhanni.features.bazaar.BazaarApi.Companion.getBazaarData -import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.ItemUtils.itemName -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.NEUInternalName -import at.hannibal2.skyhanni.utils.NumberUtil -import at.hannibal2.skyhanni.utils.RenderUtils.renderString -import io.github.moulberry.notenoughupdates.events.SlotClickEvent -import net.minecraft.item.ItemStack -import net.minecraftforge.client.event.GuiScreenEvent -import net.minecraftforge.fml.common.eventhandler.EventPriority -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class BazaarBestSellMethod { - - private var display = "" - - // Working with the last clicked item manually because - // the open inventory event happen while the recent clicked item in the inventory is not in the inventory or in the cursor slot - private var lastClickedItem: ItemStack? = null - private var nextCloseWillResetItem = false - - @SubscribeEvent - fun onInventoryClose(event: InventoryCloseEvent) { - display = "" - if (lastClickedItem != null) { - if (nextCloseWillResetItem) { - lastClickedItem = null - } - nextCloseWillResetItem = !nextCloseWillResetItem - } - } - - @SubscribeEvent - fun onBazaarOpenedProduct(event: BazaarOpenedProductEvent) { - if (!isEnabled()) return - display = updateDisplay(event.openedProduct) - } - - private fun updateDisplay(internalName: NEUInternalName?): String { - if (internalName == null) { - return "§cUnknown Bazaar item!" - } - var having = InventoryUtils.countItemsInLowerInventory { it.getInternalName() == internalName } - lastClickedItem?.let { - if (it.getInternalName() == internalName) { - having += it.stackSize - } - } - if (having <= 0) return "" - - val data = internalName.getBazaarData() ?: return "" - val totalDiff = (data.buyPrice - data.sellPrice) * having - val result = NumberUtil.format(totalDiff.toInt()) - - val name = internalName.itemName - return "$name§7 sell difference: §6$result coins" - } - - @SubscribeEvent(priority = EventPriority.LOWEST) - fun renderOverlay(event: GuiScreenEvent.BackgroundDrawnEvent) { - if (!isEnabled()) return - - SkyHanniMod.feature.bazaar.bestSellMethodPos.renderString(display, posLabel = "Bazaar Best Sell Method") - } - - @SubscribeEvent(priority = EventPriority.HIGH) - fun onStackClick(event: SlotClickEvent) { - lastClickedItem = event.slot?.stack - nextCloseWillResetItem = false - } - - private fun isEnabled() = LorenzUtils.inSkyBlock && SkyHanniMod.feature.bazaar.bestSellMethod -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarCancelledBuyOrderClipboard.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarCancelledBuyOrderClipboard.kt deleted file mode 100644 index 3c5403309..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarCancelledBuyOrderClipboard.kt +++ /dev/null @@ -1,60 +0,0 @@ -package at.hannibal2.skyhanni.features.bazaar - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.LorenzToolTipEvent -import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getLore -import at.hannibal2.skyhanni.utils.ItemUtils.name -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.OSUtils -import at.hannibal2.skyhanni.utils.StringUtils.findMatcher -import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher -import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class BazaarCancelledBuyOrderClipboard { - - private val patternGroup = RepoPattern.group("bazaar.cancelledorder") - private val lastAmountPattern by patternGroup.pattern( - "lastamount", - "§a(?.*)§7x" - ) - private val cancelledMessagePattern by patternGroup.pattern( - "cancelledmessage", - "§6\\[Bazaar] §r§7§r§cCancelled! §r§7Refunded §r§6(?.*) coins §r§7from cancelling Buy Order!" - ) - - private var latestAmount: String? = null - - @SubscribeEvent - fun onTooltip(event: LorenzToolTipEvent) { - if (!isEnabled()) return - - val stack = event.itemStack - val name = stack.name ?: return - if (!name.contains("Cancel Order")) return - - for (line in stack.getLore()) { - lastAmountPattern.findMatcher(line) { - latestAmount = group("amount") - } - } - } - - @SubscribeEvent - fun onChat(event: LorenzChatEvent) { - if (!isEnabled()) return - - cancelledMessagePattern.matchMatcher(event.message) { - event.blockedReason = "bazaar cancelled buy order clipboard" - val coins = group("coins") - ChatUtils.chat("Bazaar buy order cancelled. $latestAmount saved to clipboard. ($coins coins)") - - latestAmount?.let { OSUtils.copyToClipboard(it.replace(",", "")) } - latestAmount = null - } - } - - fun isEnabled() = LorenzUtils.inSkyBlock && SkyHanniMod.feature.bazaar.cancelledBuyOrderClipboard -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarData.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarData.kt deleted file mode 100644 index daed03152..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarData.kt +++ /dev/null @@ -1,7 +0,0 @@ -package at.hannibal2.skyhanni.features.bazaar - -data class BazaarData( - val displayName: String, - val sellPrice: Double, - val buyPrice: Double, -) \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt deleted file mode 100644 index 02e1f1446..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt +++ /dev/null @@ -1,78 +0,0 @@ -package at.hannibal2.skyhanni.features.bazaar - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.config.ConfigManager -import at.hannibal2.skyhanni.data.jsonobjects.other.SkyblockItemsDataJson -import at.hannibal2.skyhanni.features.rift.RiftAPI -import at.hannibal2.skyhanni.test.command.ErrorManager -import at.hannibal2.skyhanni.utils.APIUtil -import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.ItemUtils.name -import at.hannibal2.skyhanni.utils.NEUInternalName -import at.hannibal2.skyhanni.utils.NEUItems -import at.hannibal2.skyhanni.utils.NEUItems.getItemStackOrNull -import at.hannibal2.skyhanni.utils.NEUItems.getPrice -import at.hannibal2.skyhanni.utils.StringUtils.removeColor -import at.hannibal2.skyhanni.utils.fromJson -import kotlinx.coroutines.launch -import kotlin.concurrent.fixedRateTimer - -class BazaarDataHolder { - - companion object { - - private val bazaarData = mutableMapOf() - private var npcPrices = mapOf() - - fun getNpcPrice(internalName: NEUInternalName) = npcPrices[internalName] - } - - private fun loadNpcPrices(): MutableMap { - val list = mutableMapOf() - val apiResponse = APIUtil.getJSONResponse("https://api.hypixel.net/v2/resources/skyblock/items") - try { - val itemsData = ConfigManager.gson.fromJson(apiResponse) - - val motesPrice = mutableMapOf() - for (item in itemsData.items) { - val neuItemId = NEUItems.transHypixelNameToInternalName(item.id ?: continue) - item.npcPrice?.let { list[neuItemId] = it } - item.motesPrice?.let { motesPrice[neuItemId] = it } - } - RiftAPI.motesPrice = motesPrice - } catch (e: Throwable) { - ErrorManager.logErrorWithData( - e, "Error getting npc sell prices", - "hypixelApiResponse" to apiResponse - ) - } - return list - } - - fun start() { - SkyHanniMod.coroutineScope.launch { - npcPrices = loadNpcPrices() - } - - fixedRateTimer(name = "skyhanni-bazaar-update", period = 10_000L) { - bazaarData.clear() - } - } - - fun getData(internalName: NEUInternalName) = bazaarData[internalName] ?: createNewData(internalName) - - private fun createNewData(internalName: NEUInternalName): BazaarData? { - val stack = internalName.getItemStackOrNull() - if (stack == null) { - ChatUtils.debug("Bazaar data is null: '$internalName'") - return null - } - val displayName = stack.name!!.removeColor() - val sellPrice = internalName.getPrice(true) - val buyPrice = internalName.getPrice(false) - - val data = BazaarData(displayName, sellPrice, buyPrice) - bazaarData[internalName] = data - return data - } -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOpenPriceWebsite.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOpenPriceWebsite.kt deleted file mode 100644 index 0f03c9b0d..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOpenPriceWebsite.kt +++ /dev/null @@ -1,66 +0,0 @@ -package at.hannibal2.skyhanni.features.bazaar - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.utils.NEUInternalName -import at.hannibal2.skyhanni.utils.NEUItems -import at.hannibal2.skyhanni.utils.OSUtils -import at.hannibal2.skyhanni.utils.SimpleTimeMark -import io.github.moulberry.notenoughupdates.events.ReplaceItemEvent -import io.github.moulberry.notenoughupdates.events.SlotClickEvent -import io.github.moulberry.notenoughupdates.util.Utils -import net.minecraft.entity.player.InventoryPlayer -import net.minecraftforge.fml.common.eventhandler.EventPriority -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import kotlin.time.Duration.Companion.seconds - -class BazaarOpenPriceWebsite { - - private val config get() = SkyHanniMod.feature.bazaar - private var lastClick = SimpleTimeMark.farPast() - - private val item by lazy { - val neuItem = NEUItems.getItemStack("PAPER") - Utils.createItemStack( - neuItem.item, - "§bPrice History", - "§7Click here to open", - "§7the price history", - "§7on §cskyblock.bz" - ) - } - - @SubscribeEvent - fun replaceItem(event: ReplaceItemEvent) { - if (!isEnabled()) return - BazaarApi.currentlyOpenedProduct ?: return - if (event.inventory is InventoryPlayer) return - - if (event.slotNumber == 22) { - event.replaceWith(item) - } - } - - @SubscribeEvent(priority = EventPriority.HIGH) - fun onStackClick(event: SlotClickEvent) { - if (!isEnabled()) return - val lastItem = BazaarApi.currentlyOpenedProduct ?: return - - if (event.slotId == 22) { - event.isCanceled = true - if (lastClick.passedSince() > 0.3.seconds) { - val name = getSkyBlockBzName(lastItem) - OSUtils.openBrowser("https://www.skyblock.bz/product/$name") - lastClick = SimpleTimeMark.now() - } - } - } - - private fun getSkyBlockBzName(internalName: NEUInternalName): String { - val name = internalName.asString() - return if (name.contains(";")) { - "ENCHANTMENT_" + name.replace(";", "_") - } else name - } - - fun isEnabled() = config.openPriceWebsite -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt deleted file mode 100644 index 6a42fe214..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt +++ /dev/null @@ -1,92 +0,0 @@ -package at.hannibal2.skyhanni.features.bazaar - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.GuiContainerEvent -import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName -import at.hannibal2.skyhanni.utils.ItemUtils.getLore -import at.hannibal2.skyhanni.utils.ItemUtils.name -import at.hannibal2.skyhanni.utils.LorenzColor -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.RenderUtils.highlight -import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher -import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import net.minecraft.client.gui.inventory.GuiChest -import net.minecraft.inventory.ContainerChest -import net.minecraft.inventory.Slot -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class BazaarOrderHelper { - private val patternGroup = RepoPattern.group("bazaar.orderhelper") - private val bazaarItemNamePattern by patternGroup.pattern( - "itemname", - "§.§l(?BUY|SELL) (?.*)" - ) - private val filledPattern by patternGroup.pattern( - "filled", - "§7Filled: §[a6].*§7/.* §a§l100%!" - ) - private val pricePattern by patternGroup.pattern( - "price", - "§7Price per unit: §6(?.*) coins" - ) - - companion object { - - fun isBazaarOrderInventory(inventoryName: String): Boolean = when (inventoryName) { - "Your Bazaar Orders" -> true - "Co-op Bazaar Orders" -> true - else -> false - } - } - - @SubscribeEvent - fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.bazaar.orderHelper) return - if (event.gui !is GuiChest) return - - val guiChest = event.gui - val chest = guiChest.inventorySlots as ContainerChest - val inventoryName = chest.getInventoryName() - if (!isBazaarOrderInventory(inventoryName)) return - - for (slot in chest.inventorySlots) { - if (slot == null) continue - if (slot.slotNumber != slot.slotIndex) continue - if (slot.stack == null) continue - - val itemName = slot.stack.name ?: continue - bazaarItemNamePattern.matchMatcher(itemName) { - val buyOrSell = group("type").let { (it == "BUY") to (it == "SELL") } - if (buyOrSell.let { !it.first && !it.second }) return - - highlightItem(group("name"), slot, buyOrSell) - } - } - } - - private fun highlightItem(itemName: String, slot: Slot, buyOrSell: Pair) { - val data = BazaarApi.getBazaarDataByName(itemName) - if (data == null) { - ChatUtils.debug("Bazaar data is null for bazaarItemName '$itemName'") - return - } - - val itemLore = slot.stack.getLore() - for (line in itemLore) { - filledPattern.matchMatcher(line) { - slot highlight LorenzColor.GREEN - return - } - - pricePattern.matchMatcher(line) { - val price = group("number").replace(",", "").toDouble() - if (buyOrSell.first && price < data.sellPrice || buyOrSell.second && price > data.buyPrice) { - slot highlight LorenzColor.GOLD - return - } - } - } - } -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt index 62eff052a..033934e6f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt @@ -15,7 +15,6 @@ import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.PurseChangeCause import at.hannibal2.skyhanni.events.PurseChangeEvent import at.hannibal2.skyhanni.events.TabListUpdateEvent -import at.hannibal2.skyhanni.features.bazaar.BazaarApi.Companion.getBazaarData import at.hannibal2.skyhanni.features.combat.ghostcounter.GhostData.Option import at.hannibal2.skyhanni.features.combat.ghostcounter.GhostData.Option.KILLS import at.hannibal2.skyhanni.features.combat.ghostcounter.GhostData.bestiaryData @@ -24,6 +23,7 @@ import at.hannibal2.skyhanni.features.combat.ghostcounter.GhostUtil.formatText import at.hannibal2.skyhanni.features.combat.ghostcounter.GhostUtil.isUsingCTGhostCounter import at.hannibal2.skyhanni.features.combat.ghostcounter.GhostUtil.preFormat import at.hannibal2.skyhanni.features.combat.ghostcounter.GhostUtil.prettyTime +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi.Companion.getBazaarData import at.hannibal2.skyhanni.utils.ChatUtils.chat import at.hannibal2.skyhanni.utils.ChatUtils.clickableChat import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList diff --git a/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt index bef023755..37c92d5c0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt @@ -8,7 +8,7 @@ import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.features.bazaar.BazaarApi +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.ItemUtils diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt index 48c2f8a0c..5a8b866e7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt @@ -16,9 +16,9 @@ import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.events.NeuRepositoryReloadEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.events.TabListUpdateEvent -import at.hannibal2.skyhanni.features.bazaar.BazaarApi import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.composter.ComposterAPI.getLevel +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi import at.hannibal2.skyhanni.features.misc.items.EstimatedItemValue import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.ChatUtils diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt index 84e63ce18..f9a0f558e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt @@ -7,9 +7,6 @@ import at.hannibal2.skyhanni.events.GardenToolChangeEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.ProfileJoinEvent -import at.hannibal2.skyhanni.features.bazaar.BazaarApi.Companion.getBazaarData -import at.hannibal2.skyhanni.features.bazaar.BazaarApi.Companion.isBazaarItem -import at.hannibal2.skyhanni.features.bazaar.BazaarData import at.hannibal2.skyhanni.features.garden.CropType import at.hannibal2.skyhanni.features.garden.CropType.Companion.getByNameOrNull import at.hannibal2.skyhanni.features.garden.GardenAPI @@ -17,6 +14,9 @@ import at.hannibal2.skyhanni.features.garden.GardenNextJacobContest import at.hannibal2.skyhanni.features.garden.composter.ComposterOverlay import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed.getSpeed import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed.isSpeedDataEmpty +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi.Companion.getBazaarData +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi.Companion.isBazaarItem +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarData import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt index 0ded703ec..5818566eb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt @@ -1,8 +1,8 @@ package at.hannibal2.skyhanni.features.garden.fortuneguide.pages -import at.hannibal2.skyhanni.features.bazaar.BazaarApi import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI import at.hannibal2.skyhanni.features.garden.fortuneguide.FortuneUpgrades +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi import at.hannibal2.skyhanni.utils.GuiRenderUtils import at.hannibal2.skyhanni.utils.ItemUtils.nameWithEnchantment import at.hannibal2.skyhanni.utils.NEUItems 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 bd40ce353..38595d1bc 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 @@ -19,10 +19,10 @@ import at.hannibal2.skyhanni.events.garden.visitor.VisitorOpenEvent import at.hannibal2.skyhanni.events.garden.visitor.VisitorRefusedEvent import at.hannibal2.skyhanni.events.garden.visitor.VisitorRenderEvent import at.hannibal2.skyhanni.events.garden.visitor.VisitorToolTipEvent -import at.hannibal2.skyhanni.features.bazaar.BazaarApi import at.hannibal2.skyhanni.features.garden.CropType.Companion.getByNameOrNull import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed.getSpeed +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.ChatUtils diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt index 2a020fc8e..161c8d947 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt @@ -8,9 +8,9 @@ import at.hannibal2.skyhanni.data.jsonobjects.repo.HideNotClickableItemsJson import at.hannibal2.skyhanni.data.jsonobjects.repo.HideNotClickableItemsJson.SalvageFilter import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent -import at.hannibal2.skyhanni.features.bazaar.BazaarApi import at.hannibal2.skyhanni.features.garden.composter.ComposterOverlay import at.hannibal2.skyhanni.features.garden.visitor.VisitorAPI +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi import at.hannibal2.skyhanni.features.rift.RiftAPI import at.hannibal2.skyhanni.features.rift.RiftAPI.motesNpcPrice import at.hannibal2.skyhanni.utils.ChatUtils diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/MaxPurseItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/MaxPurseItems.kt index b0cb8d68a..5ca1c6dcb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/MaxPurseItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/MaxPurseItems.kt @@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.features.inventory import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.PurseAPI import at.hannibal2.skyhanni.events.GuiRenderEvent -import at.hannibal2.skyhanni.features.bazaar.BazaarApi +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators @@ -15,7 +15,7 @@ import net.minecraft.client.Minecraft import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class MaxPurseItems { - private val config get() = SkyHanniMod.feature.bazaar + private val config get() = SkyHanniMod.feature.inventory.bazaar private val patternGroup = RepoPattern.group("inventory.maxpurse") private val orderPattern by patternGroup.pattern( diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/PowerStoneGuideFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/PowerStoneGuideFeatures.kt index bd97c298f..bdc438fce 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/PowerStoneGuideFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/PowerStoneGuideFeatures.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent -import at.hannibal2.skyhanni.features.bazaar.BazaarApi +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi import at.hannibal2.skyhanni.utils.CollectionUtils.nextAfter import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.itemName diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt index 4255c36c7..95bcbbccc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt @@ -9,7 +9,7 @@ import at.hannibal2.skyhanni.config.features.inventory.SackDisplayConfig.Sorting import at.hannibal2.skyhanni.data.SackAPI import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.GuiRenderEvent -import at.hannibal2.skyhanni.features.bazaar.BazaarApi +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.ConfigUtils import at.hannibal2.skyhanni.utils.InventoryUtils diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt new file mode 100644 index 000000000..2d8aebe1a --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt @@ -0,0 +1,156 @@ +package at.hannibal2.skyhanni.features.inventory.bazaar + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator +import at.hannibal2.skyhanni.events.BazaarOpenedProductEvent +import at.hannibal2.skyhanni.events.GuiContainerEvent +import at.hannibal2.skyhanni.events.InventoryCloseEvent +import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.events.LorenzTickEvent +import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.ItemUtils.name +import at.hannibal2.skyhanni.utils.LorenzColor +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.NEUInternalName +import at.hannibal2.skyhanni.utils.NEUItems +import at.hannibal2.skyhanni.utils.OSUtils +import at.hannibal2.skyhanni.utils.RenderUtils.highlight +import at.hannibal2.skyhanni.utils.StringUtils.equalsIgnoreColor +import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher +import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import net.minecraft.client.gui.inventory.GuiChest +import net.minecraft.inventory.ContainerChest +import net.minecraft.item.ItemStack +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class BazaarApi { + + private var loadedNpcPriceData = false + + companion object { + + val holder = BazaarDataHolder() + var inBazaarInventory = false + private var currentSearchedItem = "" + + var currentlyOpenedProduct: NEUInternalName? = null + + fun getBazaarDataByName(name: String): BazaarData? = NEUItems.getInternalNameOrNull(name)?.getBazaarData() + + fun NEUInternalName.getBazaarData() = if (isBazaarItem()) { + holder.getData(this) + } else null + + fun isBazaarItem(stack: ItemStack): Boolean = stack.getInternalName().isBazaarItem() + + fun NEUInternalName.isBazaarItem() = NEUItems.manager.auctionManager.getBazaarInfo(asString()) != null + + fun searchForBazaarItem(displayName: String, amount: Int = -1) { + if (!LorenzUtils.inSkyBlock) return + if (NEUItems.neuHasFocus()) return + if (LorenzUtils.noTradeMode) return + if (LorenzUtils.inDungeons || LorenzUtils.inKuudraFight) return + ChatUtils.sendCommandToServer("bz ${displayName.removeColor()}") + if (amount != -1) OSUtils.copyToClipboard(amount.toString()) + currentSearchedItem = displayName.removeColor() + } + } + + @SubscribeEvent + fun onInventoryOpen(event: InventoryFullyOpenedEvent) { + inBazaarInventory = checkIfInBazaar(event) + if (inBazaarInventory) { + val itemName = getOpenedProduct(event.inventoryItems) ?: return + val openedProduct = NEUItems.getInternalNameOrNull(itemName) + currentlyOpenedProduct = openedProduct + BazaarOpenedProductEvent(openedProduct, event).postAndCatch() + } + } + + private fun getOpenedProduct(inventoryItems: Map): String? { + val buyInstantly = inventoryItems[10] ?: return null + + if (buyInstantly.displayName != "§aBuy Instantly") return null + val bazaarItem = inventoryItems[13] ?: return null + + return bazaarItem.displayName + } + + @SubscribeEvent + fun onTick(event: LorenzTickEvent) { + + if (!loadedNpcPriceData) { + loadedNpcPriceData = true + holder.start() + } + } + + @SubscribeEvent + fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { + if (!LorenzUtils.inSkyBlock) return + if (!inBazaarInventory) return + if (!SkyHanniMod.feature.inventory.bazaar.purchaseHelper) return + if (currentSearchedItem == "") return + + if (event.gui !is GuiChest) return + val guiChest = event.gui + val chest = guiChest.inventorySlots as ContainerChest + + for (slot in chest.inventorySlots) { + if (slot == null) continue + val stack = slot.stack ?: continue + + if (chest.inventorySlots.indexOf(slot) !in 9..44) { + continue + } + + if (stack.displayName.removeColor() == currentSearchedItem) { + slot highlight LorenzColor.GREEN + } + } + } + + @SubscribeEvent + fun onChat(event: LorenzChatEvent) { + if (!LorenzUtils.inSkyBlock) return + if (!inBazaarInventory) return + // TODO USE SH-REPO + // TODO remove dynamic pattern + "\\[Bazaar] (Buy Order Setup!|Bought).*$currentSearchedItem.*".toPattern() + .matchMatcher(event.message.removeColor()) { currentSearchedItem = "" } + } + + private fun checkIfInBazaar(event: InventoryFullyOpenedEvent): Boolean { + val items = event.inventorySize.let { listOf(it - 5, it - 6) }.mapNotNull { event.inventoryItems[it] } + if (items.any { it.name.equalsIgnoreColor("Go Back") && it.getLore().firstOrNull() == "§7To Bazaar" }) { + return true + } + + if (event.inventoryName.startsWith("Bazaar ➜ ")) return true + return when (event.inventoryName) { + "How many do you want?" -> true + "How much do you want to pay?" -> true + "Confirm Buy Order" -> true + "Confirm Instant Buy" -> true + "At what price are you selling?" -> true + "Confirm Sell Offer" -> true + "Order options" -> true + + else -> false + } + } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(25, "bazaar", "inventory.bazaar") + } + + @SubscribeEvent + fun onInventoryClose(event: InventoryCloseEvent) { + inBazaarInventory = false + currentlyOpenedProduct = null + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarBestSellMethod.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarBestSellMethod.kt new file mode 100644 index 000000000..9391e09db --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarBestSellMethod.kt @@ -0,0 +1,81 @@ +package at.hannibal2.skyhanni.features.inventory.bazaar + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.BazaarOpenedProductEvent +import at.hannibal2.skyhanni.events.InventoryCloseEvent +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi.Companion.getBazaarData +import at.hannibal2.skyhanni.utils.InventoryUtils +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.itemName +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.NEUInternalName +import at.hannibal2.skyhanni.utils.NumberUtil +import at.hannibal2.skyhanni.utils.RenderUtils.renderString +import io.github.moulberry.notenoughupdates.events.SlotClickEvent +import net.minecraft.item.ItemStack +import net.minecraftforge.client.event.GuiScreenEvent +import net.minecraftforge.fml.common.eventhandler.EventPriority +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class BazaarBestSellMethod { + private val config get() = SkyHanniMod.feature.inventory.bazaar + + private var display = "" + + // Working with the last clicked item manually because + // the open inventory event happen while the recent clicked item in the inventory is not in the inventory or in the cursor slot + private var lastClickedItem: ItemStack? = null + private var nextCloseWillResetItem = false + + @SubscribeEvent + fun onInventoryClose(event: InventoryCloseEvent) { + display = "" + if (lastClickedItem != null) { + if (nextCloseWillResetItem) { + lastClickedItem = null + } + nextCloseWillResetItem = !nextCloseWillResetItem + } + } + + @SubscribeEvent + fun onBazaarOpenedProduct(event: BazaarOpenedProductEvent) { + if (!isEnabled()) return + display = updateDisplay(event.openedProduct) + } + + private fun updateDisplay(internalName: NEUInternalName?): String { + if (internalName == null) { + return "§cUnknown Bazaar item!" + } + var having = InventoryUtils.countItemsInLowerInventory { it.getInternalName() == internalName } + lastClickedItem?.let { + if (it.getInternalName() == internalName) { + having += it.stackSize + } + } + if (having <= 0) return "" + + val data = internalName.getBazaarData() ?: return "" + val totalDiff = (data.buyPrice - data.sellPrice) * having + val result = NumberUtil.format(totalDiff.toInt()) + + val name = internalName.itemName + return "$name§7 sell difference: §6$result coins" + } + + @SubscribeEvent(priority = EventPriority.LOWEST) + fun renderOverlay(event: GuiScreenEvent.BackgroundDrawnEvent) { + if (!isEnabled()) return + + config.bestSellMethodPos.renderString(display, posLabel = "Bazaar Best Sell Method") + } + + @SubscribeEvent(priority = EventPriority.HIGH) + fun onStackClick(event: SlotClickEvent) { + lastClickedItem = event.slot?.stack + nextCloseWillResetItem = false + } + + private fun isEnabled() = LorenzUtils.inSkyBlock && config.bestSellMethod +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarCancelledBuyOrderClipboard.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarCancelledBuyOrderClipboard.kt new file mode 100644 index 000000000..e0487ecb5 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarCancelledBuyOrderClipboard.kt @@ -0,0 +1,60 @@ +package at.hannibal2.skyhanni.features.inventory.bazaar + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.events.LorenzToolTipEvent +import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.ItemUtils.name +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.OSUtils +import at.hannibal2.skyhanni.utils.StringUtils.findMatcher +import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher +import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class BazaarCancelledBuyOrderClipboard { + + private val patternGroup = RepoPattern.group("bazaar.cancelledorder") + private val lastAmountPattern by patternGroup.pattern( + "lastamount", + "§a(?.*)§7x" + ) + private val cancelledMessagePattern by patternGroup.pattern( + "cancelledmessage", + "§6\\[Bazaar] §r§7§r§cCancelled! §r§7Refunded §r§6(?.*) coins §r§7from cancelling Buy Order!" + ) + + private var latestAmount: String? = null + + @SubscribeEvent + fun onTooltip(event: LorenzToolTipEvent) { + if (!isEnabled()) return + + val stack = event.itemStack + val name = stack.name ?: return + if (!name.contains("Cancel Order")) return + + for (line in stack.getLore()) { + lastAmountPattern.findMatcher(line) { + latestAmount = group("amount") + } + } + } + + @SubscribeEvent + fun onChat(event: LorenzChatEvent) { + if (!isEnabled()) return + + cancelledMessagePattern.matchMatcher(event.message) { + event.blockedReason = "bazaar cancelled buy order clipboard" + val coins = group("coins") + ChatUtils.chat("Bazaar buy order cancelled. $latestAmount saved to clipboard. ($coins coins)") + + latestAmount?.let { OSUtils.copyToClipboard(it.replace(",", "")) } + latestAmount = null + } + } + + fun isEnabled() = LorenzUtils.inSkyBlock && SkyHanniMod.feature.inventory.bazaar.cancelledBuyOrderClipboard +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarData.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarData.kt new file mode 100644 index 000000000..ed49359bb --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarData.kt @@ -0,0 +1,7 @@ +package at.hannibal2.skyhanni.features.inventory.bazaar + +data class BazaarData( + val displayName: String, + val sellPrice: Double, + val buyPrice: Double, +) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarDataHolder.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarDataHolder.kt new file mode 100644 index 000000000..7061b7e63 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarDataHolder.kt @@ -0,0 +1,78 @@ +package at.hannibal2.skyhanni.features.inventory.bazaar + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigManager +import at.hannibal2.skyhanni.data.jsonobjects.other.SkyblockItemsDataJson +import at.hannibal2.skyhanni.features.rift.RiftAPI +import at.hannibal2.skyhanni.test.command.ErrorManager +import at.hannibal2.skyhanni.utils.APIUtil +import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.utils.ItemUtils.name +import at.hannibal2.skyhanni.utils.NEUInternalName +import at.hannibal2.skyhanni.utils.NEUItems +import at.hannibal2.skyhanni.utils.NEUItems.getItemStackOrNull +import at.hannibal2.skyhanni.utils.NEUItems.getPrice +import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import at.hannibal2.skyhanni.utils.fromJson +import kotlinx.coroutines.launch +import kotlin.concurrent.fixedRateTimer + +class BazaarDataHolder { + + companion object { + + private val bazaarData = mutableMapOf() + private var npcPrices = mapOf() + + fun getNpcPrice(internalName: NEUInternalName) = npcPrices[internalName] + } + + private fun loadNpcPrices(): MutableMap { + val list = mutableMapOf() + val apiResponse = APIUtil.getJSONResponse("https://api.hypixel.net/v2/resources/skyblock/items") + try { + val itemsData = ConfigManager.gson.fromJson(apiResponse) + + val motesPrice = mutableMapOf() + for (item in itemsData.items) { + val neuItemId = NEUItems.transHypixelNameToInternalName(item.id ?: continue) + item.npcPrice?.let { list[neuItemId] = it } + item.motesPrice?.let { motesPrice[neuItemId] = it } + } + RiftAPI.motesPrice = motesPrice + } catch (e: Throwable) { + ErrorManager.logErrorWithData( + e, "Error getting npc sell prices", + "hypixelApiResponse" to apiResponse + ) + } + return list + } + + fun start() { + SkyHanniMod.coroutineScope.launch { + npcPrices = loadNpcPrices() + } + + fixedRateTimer(name = "skyhanni-bazaar-update", period = 10_000L) { + bazaarData.clear() + } + } + + fun getData(internalName: NEUInternalName) = bazaarData[internalName] ?: createNewData(internalName) + + private fun createNewData(internalName: NEUInternalName): BazaarData? { + val stack = internalName.getItemStackOrNull() + if (stack == null) { + ChatUtils.debug("Bazaar data is null: '$internalName'") + return null + } + val displayName = stack.name!!.removeColor() + val sellPrice = internalName.getPrice(true) + val buyPrice = internalName.getPrice(false) + + val data = BazaarData(displayName, sellPrice, buyPrice) + bazaarData[internalName] = data + return data + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOpenPriceWebsite.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOpenPriceWebsite.kt new file mode 100644 index 000000000..cb9bf31bc --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOpenPriceWebsite.kt @@ -0,0 +1,66 @@ +package at.hannibal2.skyhanni.features.inventory.bazaar + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.utils.NEUInternalName +import at.hannibal2.skyhanni.utils.NEUItems +import at.hannibal2.skyhanni.utils.OSUtils +import at.hannibal2.skyhanni.utils.SimpleTimeMark +import io.github.moulberry.notenoughupdates.events.ReplaceItemEvent +import io.github.moulberry.notenoughupdates.events.SlotClickEvent +import io.github.moulberry.notenoughupdates.util.Utils +import net.minecraft.entity.player.InventoryPlayer +import net.minecraftforge.fml.common.eventhandler.EventPriority +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import kotlin.time.Duration.Companion.seconds + +class BazaarOpenPriceWebsite { + + private val config get() = SkyHanniMod.feature.inventory.bazaar + private var lastClick = SimpleTimeMark.farPast() + + private val item by lazy { + val neuItem = NEUItems.getItemStack("PAPER") + Utils.createItemStack( + neuItem.item, + "§bPrice History", + "§7Click here to open", + "§7the price history", + "§7on §cskyblock.bz" + ) + } + + @SubscribeEvent + fun replaceItem(event: ReplaceItemEvent) { + if (!isEnabled()) return + BazaarApi.currentlyOpenedProduct ?: return + if (event.inventory is InventoryPlayer) return + + if (event.slotNumber == 22) { + event.replaceWith(item) + } + } + + @SubscribeEvent(priority = EventPriority.HIGH) + fun onStackClick(event: SlotClickEvent) { + if (!isEnabled()) return + val lastItem = BazaarApi.currentlyOpenedProduct ?: return + + if (event.slotId == 22) { + event.isCanceled = true + if (lastClick.passedSince() > 0.3.seconds) { + val name = getSkyBlockBzName(lastItem) + OSUtils.openBrowser("https://www.skyblock.bz/product/$name") + lastClick = SimpleTimeMark.now() + } + } + } + + private fun getSkyBlockBzName(internalName: NEUInternalName): String { + val name = internalName.asString() + return if (name.contains(";")) { + "ENCHANTMENT_" + name.replace(";", "_") + } else name + } + + fun isEnabled() = config.openPriceWebsite +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOrderHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOrderHelper.kt new file mode 100644 index 000000000..9e9d31f04 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOrderHelper.kt @@ -0,0 +1,92 @@ +package at.hannibal2.skyhanni.features.inventory.bazaar + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.GuiContainerEvent +import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName +import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.ItemUtils.name +import at.hannibal2.skyhanni.utils.LorenzColor +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.RenderUtils.highlight +import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher +import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern +import net.minecraft.client.gui.inventory.GuiChest +import net.minecraft.inventory.ContainerChest +import net.minecraft.inventory.Slot +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class BazaarOrderHelper { + private val patternGroup = RepoPattern.group("bazaar.orderhelper") + private val bazaarItemNamePattern by patternGroup.pattern( + "itemname", + "§.§l(?BUY|SELL) (?.*)" + ) + private val filledPattern by patternGroup.pattern( + "filled", + "§7Filled: §[a6].*§7/.* §a§l100%!" + ) + private val pricePattern by patternGroup.pattern( + "price", + "§7Price per unit: §6(?.*) coins" + ) + + companion object { + + fun isBazaarOrderInventory(inventoryName: String): Boolean = when (inventoryName) { + "Your Bazaar Orders" -> true + "Co-op Bazaar Orders" -> true + else -> false + } + } + + @SubscribeEvent + fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { + if (!LorenzUtils.inSkyBlock) return + if (!SkyHanniMod.feature.inventory.bazaar.orderHelper) return + if (event.gui !is GuiChest) return + + val guiChest = event.gui + val chest = guiChest.inventorySlots as ContainerChest + val inventoryName = chest.getInventoryName() + if (!isBazaarOrderInventory(inventoryName)) return + + for (slot in chest.inventorySlots) { + if (slot == null) continue + if (slot.slotNumber != slot.slotIndex) continue + if (slot.stack == null) continue + + val itemName = slot.stack.name ?: continue + bazaarItemNamePattern.matchMatcher(itemName) { + val buyOrSell = group("type").let { (it == "BUY") to (it == "SELL") } + if (buyOrSell.let { !it.first && !it.second }) return + + highlightItem(group("name"), slot, buyOrSell) + } + } + } + + private fun highlightItem(itemName: String, slot: Slot, buyOrSell: Pair) { + val data = BazaarApi.getBazaarDataByName(itemName) + if (data == null) { + ChatUtils.debug("Bazaar data is null for bazaarItemName '$itemName'") + return + } + + val itemLore = slot.stack.getLore() + for (line in itemLore) { + filledPattern.matchMatcher(line) { + slot highlight LorenzColor.GREEN + return + } + + pricePattern.matchMatcher(line) { + val price = group("number").replace(",", "").toDouble() + if (buyOrSell.first && price < data.sellPrice || buyOrSell.second && price > data.buyPrice) { + slot highlight LorenzColor.GOLD + return + } + } + } + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index 62f49f42f..12acfb2ff 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.config.ConfigManager import at.hannibal2.skyhanni.data.jsonobjects.repo.MultiFilterJson import at.hannibal2.skyhanni.events.NeuRepositoryReloadEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent -import at.hannibal2.skyhanni.features.bazaar.BazaarDataHolder +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarDataHolder import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.ItemBlink.checkBlinkItem import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt index b4f7bfef0..8eebcd2aa 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt @@ -6,7 +6,7 @@ import at.hannibal2.skyhanni.config.core.config.Position import at.hannibal2.skyhanni.config.features.misc.TrackerConfig.PriceFromEntry import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.TrackerManager -import at.hannibal2.skyhanni.features.bazaar.BazaarApi.Companion.getBazaarData +import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi.Companion.getBazaarData import at.hannibal2.skyhanni.features.misc.items.EstimatedItemValue import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList -- cgit