diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-21 19:28:32 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-21 19:28:32 +0100 |
commit | 8dcd991f418b8027b9e42b3afb87f28fbbe9c19a (patch) | |
tree | f0b931adedc5d030e4681c33c68f4931d50a671b /src/main/java/at/hannibal2/skyhanni/features | |
parent | 9e4689911c9ecd1514492f517f2813b1c64619de (diff) | |
download | skyhanni-8dcd991f418b8027b9e42b3afb87f28fbbe9c19a.tar.gz skyhanni-8dcd991f418b8027b9e42b3afb87f28fbbe9c19a.tar.bz2 skyhanni-8dcd991f418b8027b9e42b3afb87f28fbbe9c19a.zip |
Fixed visitor data gets lost sometimes after world switch
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt index 1c7763f57..fb08d212c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt @@ -13,6 +13,7 @@ import at.hannibal2.skyhanni.utils.RenderUtils.drawString import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems import at.hannibal2.skyhanni.utils.StringUtils.removeColor import io.github.moulberry.notenoughupdates.events.SlotClickEvent +import io.github.moulberry.notenoughupdates.util.SBInfo import net.minecraft.client.Minecraft import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand @@ -296,7 +297,10 @@ class GardenVisitorFeatures { visitorsInTab.add(name) } } - if (visitors.keys.removeIf { it !in visitorsInTab }) { + if (visitors.keys.removeIf { + val time = System.currentTimeMillis() - SBInfo.getInstance().joinedWorld + it !in visitorsInTab && time > 2_000 + }) { updateDisplay() } for (name in visitorsInTab) { |