diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-26 12:30:02 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-26 12:30:02 +0200 |
commit | b6f9dc6caa77ef50e086fd50c6c32ebc69288eb8 (patch) | |
tree | 1532b36ad847210aae4968433cacbbe9f036f664 /src/main/java/at/hannibal2/skyhanni/features | |
parent | 2c061eb7fc7c6f8f4e5889504e6b390c71e6a269 (diff) | |
download | skyhanni-b6f9dc6caa77ef50e086fd50c6c32ebc69288eb8.tar.gz skyhanni-b6f9dc6caa77ef50e086fd50c6c32ebc69288eb8.tar.bz2 skyhanni-b6f9dc6caa77ef50e086fd50c6c32ebc69288eb8.zip |
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt | 18 |
1 files changed, 10 insertions, 8 deletions
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 11cddf73b..7e1c50f1b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt @@ -5,13 +5,17 @@ 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.utils.* +import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.LorenzColor +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.LorenzUtils.addButton import at.hannibal2.skyhanni.utils.LorenzUtils.addSelector import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName +import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.NEUItems.getItemStack +import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber import at.hannibal2.skyhanni.utils.RenderUtils.highlight @@ -23,7 +27,6 @@ object SackDisplay { private var display = emptyList<List<Any>>() private val config get() = SkyHanniMod.feature.inventory.sackDisplay - @SubscribeEvent fun onBackgroundDraw(event: GuiRenderEvent.ChestGuiOverlayRenderEvent) { if (SackAPI.inSackInventory) { @@ -39,9 +42,8 @@ object SackDisplay { if (!SackAPI.inSackInventory) return if (!config.highlightFull) return for (slot in InventoryUtils.getItemsInOpenChest()) { - val stack = slot.stack - val lore = stack.getLore() - if (lore.any { it.startsWith("§7Stored: §a")}) { + val lore = slot.stack.getLore() + if (lore.any { it.startsWith("§7Stored: §a") }) { slot highlight LorenzColor.RED } } @@ -122,6 +124,8 @@ object SackDisplay { rendered++ } + if (SackAPI.isTrophySack) newDisplay.addAsSingletonList("§cTotal Magmafish: §6${totalMagmaFish.addSeparators()}") + val name = SortType.entries[config.sortingType].longName newDisplay.addAsSingletonList("§7Sorted By: §c$name") @@ -133,8 +137,6 @@ object SackDisplay { update(false) }) - if (SackAPI.isTrophySack) newDisplay.addAsSingletonList("§cTotal Magmafish: §6${totalMagmaFish.addSeparators()}") - newDisplay.addButton( prefix = "§7Number format: ", getName = NumberFormat.entries[config.numberFormat].DisplayName, @@ -227,4 +229,4 @@ object SackDisplay { FORMATTED("Formatted"), UNFORMATTED("Unformatted") } -}
\ No newline at end of file +} |