diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-04-18 00:25:16 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-17 16:25:16 +0200 |
commit | bf0a964361373944f5d50b7a824b23d6507941b4 (patch) | |
tree | 58db7a702ec5df0c6f0642eceb226c105c445464 | |
parent | 546a2047d4e8134ab94e327d1be37442349a9576 (diff) | |
download | skyhanni-bf0a964361373944f5d50b7a824b23d6507941b4.tar.gz skyhanni-bf0a964361373944f5d50b7a824b23d6507941b4.tar.bz2 skyhanni-bf0a964361373944f5d50b7a824b23d6507941b4.zip |
Fix: Stop rendering an empty string on every item (#1465)
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/events/RenderItemTipEvent.kt | 1 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/events/RenderItemTipEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/RenderItemTipEvent.kt index d9341cc87..5a144cb7e 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/RenderItemTipEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/RenderItemTipEvent.kt @@ -9,6 +9,7 @@ class RenderItemTipEvent( var stackTip = "" set(value) { + if (value.isEmpty()) return renderObjects.add(RenderObject(value, 0, 0)) } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt index bebac7d45..23aadf86b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -82,10 +82,10 @@ object ItemDisplayOverlayFeatures { @SubscribeEvent fun onRenderItemTip(event: RenderItemTipEvent) { - event.stackTip = getStackTip(event.stack) + event.stackTip = getStackTip(event.stack) ?: return } - private fun getStackTip(item: ItemStack): String { + private fun getStackTip(item: ItemStack): String? { val itemName = item.cleanName() val internalName = item.getInternalName() val chestName = InventoryUtils.openInventoryName() @@ -258,7 +258,7 @@ object ItemDisplayOverlayFeatures { } } - return "" + return null } private fun isOwnVacuum(lore: List<String>) = |