summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
diff options
context:
space:
mode:
authorEmpa <42304516+ItsEmpa@users.noreply.github.com>2024-06-09 19:41:41 +0200
committerGitHub <noreply@github.com>2024-06-09 19:41:41 +0200
commitcc629382945460d48fc9fa6472106df9fcbb589d (patch)
tree64caa8a0cee2d321f700b7d97fb13754319f82d4 /src/main/java/at/hannibal2/skyhanni/features/misc
parentfc8e81a9f88b01ec63d8fa1d7f0d6ebbdc51d836 (diff)
downloadskyhanni-cc629382945460d48fc9fa6472106df9fcbb589d.tar.gz
skyhanni-cc629382945460d48fc9fa6472106df9fcbb589d.tar.bz2
skyhanni-cc629382945460d48fc9fa6472106df9fcbb589d.zip
Feature: Custom Wardrobe (#2039)
Co-authored-by: J10a1n15 <45315647+j10a1n15@users.noreply.github.com> Co-authored-by: Cal <cwolfson58@gmail.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedWardrobePrice.kt74
1 files changed, 0 insertions, 74 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedWardrobePrice.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedWardrobePrice.kt
deleted file mode 100644
index 5e536ad01..000000000
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedWardrobePrice.kt
+++ /dev/null
@@ -1,74 +0,0 @@
-package at.hannibal2.skyhanni.features.misc.items
-
-import at.hannibal2.skyhanni.SkyHanniMod
-import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
-import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
-import at.hannibal2.skyhanni.events.LorenzToolTipEvent
-import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
-import at.hannibal2.skyhanni.utils.InventoryUtils
-import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull
-import at.hannibal2.skyhanni.utils.ItemUtils.name
-import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.NumberUtil
-import net.minecraft.item.ItemStack
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
-
-@SkyHanniModule
-object EstimatedWardrobePrice {
-
- private val config get() = SkyHanniMod.feature.inventory.estimatedItemValues
- var data = mutableMapOf<Int, MutableList<ItemStack>>()
-
- @SubscribeEvent
- fun onTooltip(event: LorenzToolTipEvent) {
- if (!LorenzUtils.inSkyBlock) return
- if (!config.armor) return
- if (!InventoryUtils.openInventoryName().contains("Wardrobe")) return
-
- val slot = event.slot.slotNumber
- val id = slot % 9
- // Only showing in the armor select line
- if (slot - id != 36) return
- val items = data[id] ?: return
-
- var index = 3
- val toolTip = event.toolTip
- if (toolTip.size < 4) return
- toolTip.add(index++, "")
- toolTip.add(index++, "§aEstimated Armor Value:")
-
- var totalPrice = 0.0
- for (item in items) {
-
- val price = EstimatedItemValueCalculator.getTotalPrice(item)
- totalPrice += price
-
- toolTip.add(index++, " §7- ${item.name}: §6${NumberUtil.format(price)}")
- }
- toolTip.add(index, " §aTotal Value: §6§l${NumberUtil.format(totalPrice)} coins")
- }
-
- @SubscribeEvent
- fun onInventoryOpen(event: InventoryFullyOpenedEvent) {
- if (!LorenzUtils.inSkyBlock) return
- if (!config.armor) return
- if (!event.inventoryName.startsWith("Wardrobe")) return
-
- val map = mutableMapOf<Int, MutableList<ItemStack>>()
-
- for ((slot, item) in event.inventoryItems) {
- item.getInternalNameOrNull() ?: continue
- val price = EstimatedItemValueCalculator.getTotalPrice(item)
- if (price == 0.0) continue
- val id = slot % 9
- val list = map.getOrPut(id) { mutableListOf() }
- list.add(item)
- }
- data = map
- }
-
- @SubscribeEvent
- fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
- event.move(3, "misc.estimatedIemValueArmor", "misc.estimatedItemValues.armor")
- }
-}