From 18245e2630bfb8242d4519d2b17bf6243808e081 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 1 May 2023 18:07:58 +0200 Subject: Using LorenzUtils.lastWorldSwitch --- src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt index 5bafff0ba..3e6e69f41 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt @@ -11,7 +11,6 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems import net.minecraft.item.ItemStack import net.minecraft.network.play.server.S2FPacketSetSlot -import net.minecraftforge.event.world.WorldEvent import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -64,13 +63,7 @@ class OwnInventoryData { lastClose = System.currentTimeMillis() } - @SubscribeEvent - fun onWorldLoad(event: WorldEvent.Load) { - lastWorldSwitch = System.currentTimeMillis() - } - private var lastClose = 0L - private var lastWorldSwitch = 0L private fun add(item: ItemStack?, add: Int) { if (item == null) return @@ -78,7 +71,7 @@ class OwnInventoryData { val diffClose = System.currentTimeMillis() - lastClose if (diffClose < 500) return - val diffWorld = System.currentTimeMillis() - lastWorldSwitch + val diffWorld = System.currentTimeMillis() - LorenzUtils.lastWorldSwitch if (diffWorld < 3_000) return val internalName = item.getInternalName() -- cgit