aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-12-29 19:23:47 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-12-29 19:23:47 +0100
commitb7d95a344ddf32ba004797aab5500555555d7834 (patch)
tree3f1a23f4705336b2f3a56de4c8e1b0d04c041ea9
parent5689117e8d5f1ba39aef4c9c60529fb5a697b25d (diff)
downloadskyhanni-b7d95a344ddf32ba004797aab5500555555d7834.tar.gz
skyhanni-b7d95a344ddf32ba004797aab5500555555d7834.tar.bz2
skyhanni-b7d95a344ddf32ba004797aab5500555555d7834.zip
removed item tip cache
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt
index 1701a63e2..69ae9fa2d 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt
@@ -5,7 +5,6 @@ import at.hannibal2.skyhanni.events.GuiRenderItemEvent
import at.hannibal2.skyhanni.events.RenderInventoryItemTipEvent
import at.hannibal2.skyhanni.events.RenderItemTipEvent
import at.hannibal2.skyhanni.mixins.transformers.gui.AccessorGuiContainer
-import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.LorenzUtils
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.inventory.GuiChest
@@ -15,25 +14,25 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class ItemTipHelper {
- private val lastColorCacheTime = HashMap<String, Long>()
- private val cache = HashMap<String, String>()
+// private val lastColorCacheTime = HashMap<String, Long>()
+// private val cache = HashMap<String, String>()
@SubscribeEvent
fun onRenderItemOverlayPost(event: GuiRenderItemEvent.RenderOverlayEvent.GuiRenderItemPost) {
val stack = event.stack ?: return
if (!LorenzUtils.inSkyblock || stack.stackSize != 1) return
- val uuid = stack.getLore().joinToString { ", " }
+// val uuid = stacremovek.getLore().joinToString { ", " }
val stackTip: String
- if (lastColorCacheTime.getOrDefault(uuid, 0L) + 1000 > System.currentTimeMillis()) {
- stackTip = cache[uuid]!!
- } else {
+// if (lastColorCacheTime.getOrDefault(uuid, 0L) + 1000 > System.currentTimeMillis()) {
+// stackTip = cache[uuid]!!
+// } else {
val itemTipEvent = RenderItemTipEvent(stack)
itemTipEvent.postAndCatch()
stackTip = itemTipEvent.stackTip
- cache[uuid] = stackTip
- lastColorCacheTime[uuid] = System.currentTimeMillis()
- }
+// cache[uuid] = stackTip
+// lastColorCacheTime[uuid] = System.currentTimeMillis()
+// }
if (stackTip.isEmpty()) return