diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-16 19:51:53 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-16 19:51:53 +0200 |
commit | d82f1a825da599650ee2b6aab84a97e90abf4745 (patch) | |
tree | d12df6794deb7aedea8ba620dc611e7423012fca /src/main/java/at/hannibal2/skyhanni/features/garden | |
parent | f01195b5cf091dedbddd5e76b3a7e273b89fe2db (diff) | |
download | skyhanni-d82f1a825da599650ee2b6aab84a97e90abf4745.tar.gz skyhanni-d82f1a825da599650ee2b6aab84a97e90abf4745.tar.bz2 skyhanni-d82f1a825da599650ee2b6aab84a97e90abf4745.zip |
Fixed bazaar detection with turbo books again
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
3 files changed, 6 insertions, 16 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt index ed95ee8b4..78eb2bcaa 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt @@ -8,7 +8,7 @@ import at.hannibal2.skyhanni.features.garden.visitor.GardenVisitorFeatures import at.hannibal2.skyhanni.utils.ItemUtils 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.ItemUtils.nameWithEnchantment import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.NEUItems @@ -64,16 +64,12 @@ class AnitaMedalProfit { } private fun readItem(item: ItemStack, table: MutableMap<Pair<String, String>, Pair<Double, String>>) { - var itemName = item.name ?: return + val itemName = item.nameWithEnchantment ?: return if (itemName == " ") return if (itemName == "§cClose") return if (itemName == "§eUnique Gold Medals") return if (itemName == "§aMedal Trades") return - if (itemName.endsWith("Enchanted Book")) { - itemName = item.getLore()[0] - } - val fullCost = getFullCost(getRequiredItems(item)) if (fullCost < 0) return 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 1c0ab2b47..979f7d6b8 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 @@ -90,10 +90,8 @@ class CropMoneyDisplay { var extraNetherWartPrices = 0.0 GardenAPI.cropInHand?.let { - val heldItem = Minecraft.getMinecraft().thePlayer.heldItem - val reforgeName = heldItem.getReforgeName() - val bountiful = reforgeName == "bountiful" - toolHasBountiful[it] = bountiful + val reforgeName = Minecraft.getMinecraft().thePlayer.heldItem?.getReforgeName() + toolHasBountiful[it] = reforgeName == "bountiful" if (GardenAPI.mushroomCowPet && it != CropType.MUSHROOM) { if (!GardenCropMilestoneDisplay.mushroom_cow_nether_warts || it != CropType.NETHER_WART) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt index 946d40884..4aa36fd23 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt @@ -7,7 +7,7 @@ import at.hannibal2.skyhanni.events.InventoryOpenEvent import at.hannibal2.skyhanni.features.garden.GardenAPI 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.ItemUtils.nameWithEnchantment import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.NEUItems @@ -47,11 +47,7 @@ class SkyMartCopperPrice { val priceFormat = NumberUtil.format(lowestBin) val amountFormat = NumberUtil.format(amount) - var name = stack.name!! - if (name == "§fEnchanted Book") { - name = stack.getLore()[0] - } - + val name = stack.nameWithEnchantment!! val advancedStats = if (config.skyMartCopperPriceAdvancedStats) { " §7(§6$priceFormat §7/ §c$amountFormat Copper§7)" } else "" |