diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-01 18:07:58 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-01 18:07:58 +0200 |
commit | 18245e2630bfb8242d4519d2b17bf6243808e081 (patch) | |
tree | a7390191b787ec0f79ce4af4a491f037d5ab1b1e /src/main/java/at | |
parent | e9f20ac0d212964ae57dcdbacd025045d208391e (diff) | |
download | skyhanni-18245e2630bfb8242d4519d2b17bf6243808e081.tar.gz skyhanni-18245e2630bfb8242d4519d2b17bf6243808e081.tar.bz2 skyhanni-18245e2630bfb8242d4519d2b17bf6243808e081.zip |
Using LorenzUtils.lastWorldSwitch
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt | 9 |
1 files changed, 1 insertions, 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() |