diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2023-06-19 19:48:18 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-19 11:48:18 +0200 |
commit | 64e59b4a917f6d71868f3722f65700a592404388 (patch) | |
tree | bbd256ba0f4bf9591cdff0e1bde416d98c7f4f9c /src/main/java/at/hannibal2/skyhanni/features/garden | |
parent | b14d79c5a5e7d245398b7d697cef305bbbed2ad7 (diff) | |
download | skyhanni-64e59b4a917f6d71868f3722f65700a592404388.tar.gz skyhanni-64e59b4a917f6d71868f3722f65700a592404388.tar.bz2 skyhanni-64e59b4a917f6d71868f3722f65700a592404388.zip |
Merge pull request #241
* BazaarApi searching
* Highlight Item
* Resetting on purchase and only highlights correct one
* adding default value
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
3 files changed, 12 insertions, 12 deletions
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 241f6cbcd..5c67ea67e 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 @@ -3,19 +3,23 @@ package at.hannibal2.skyhanni.features.garden.composter import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.model.ComposterUpgrade import at.hannibal2.skyhanni.events.* +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.utils.* import at.hannibal2.skyhanni.utils.ItemUtils.name +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.LorenzUtils.addSelector import at.hannibal2.skyhanni.utils.LorenzUtils.round import at.hannibal2.skyhanni.utils.LorenzUtils.sortedDesc +import at.hannibal2.skyhanni.utils.NEUItems +import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import at.hannibal2.skyhanni.utils.TimeUtils import at.hannibal2.skyhanni.utils.jsonobjects.GardenJson import at.hannibal2.skyhanni.utils.renderables.Renderable import io.github.moulberry.notenoughupdates.NotEnoughUpdates @@ -389,10 +393,9 @@ class ComposterOverlay { val name = itemName.substring(0, 2) + selected + rawItemName list.add(Renderable.link("$name§r §8x${itemsNeeded.addSeparators()} §7(§6$format§7)") { onClick(internalName) - if (LorenzUtils.isControlKeyDown() && !LorenzUtils.noTradeMode) { + if (LorenzUtils.isControlKeyDown()) { inInventory = false - LorenzUtils.sendCommandToServer("bz $rawItemName") - OSUtils.copyToClipboard("${itemsNeeded.toInt()}") + BazaarApi.searchForBazaarItem(itemName, itemsNeeded.toInt()) } }) bigList.add(list) 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 36f67eab6..e04c0dc54 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,13 +1,12 @@ 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.utils.GuiRenderUtils import at.hannibal2.skyhanni.utils.ItemUtils.nameWithEnchantment -import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.NumberUtil -import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraft.client.renderer.GlStateManager import net.minecraft.util.MathHelper import java.text.DecimalFormat @@ -38,9 +37,7 @@ class UpgradePage: FFGuideGUI.FFGuidePage() { var formattedUpgrade = upgradeItem.nameWithEnchantment ?: return if (adjustedY + 25 * index - 5 < FFGuideGUI.lastClickedHeight && FFGuideGUI.lastClickedHeight < adjustedY + 25 * index + 10) { FFGuideGUI.lastClickedHeight = 0 - if (!NEUItems.neuHasFocus() && !LorenzUtils.noTradeMode) { - LorenzUtils.sendCommandToServer("bz ${formattedUpgrade.removeColor()}") - } + BazaarApi.searchForBazaarItem(formattedUpgrade, upgrade.itemQuantity) } if (upgrade.itemQuantity != 1) { formattedUpgrade = "$formattedUpgrade §fx${upgrade.itemQuantity}" 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 973f122d5..f7fedd18c 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 @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.TitleUtils import at.hannibal2.skyhanni.events.* +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 @@ -175,9 +176,8 @@ class GardenVisitorFeatures { list.add(Renderable.optionalLink("$name §ex${amount.addSeparators()}", { if (Minecraft.getMinecraft().currentScreen is GuiEditSign) { LorenzUtils.setTextIntoSign("$amount") - } else if (!NEUItems.neuHasFocus() && !LorenzUtils.noTradeMode) { - LorenzUtils.sendCommandToServer("bz ${name.removeColor()}") - OSUtils.copyToClipboard("$amount") + } else { + BazaarApi.searchForBazaarItem(name, amount) } }) { GardenAPI.inGarden() && !NEUItems.neuHasFocus() }) |