From fca3cf865a62b1cd2c9d272e627e5c206954b520 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 26 Feb 2023 18:39:21 +0100 Subject: Clearing tab list data after world switch. this can semi-fix the visitor timer stuck bug by switching worlds. --- src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt b/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt index 760e40450..4faa73cff 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt @@ -4,16 +4,22 @@ import at.hannibal2.skyhanni.events.PacketEvent import at.hannibal2.skyhanni.events.TabListUpdateEvent import at.hannibal2.skyhanni.utils.LorenzUtils.sorted import net.minecraft.network.play.server.S38PacketPlayerListItem +import net.minecraftforge.event.world.WorldEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.* class TabListData { - private val uuidMap = mutableMapOf() private val tabListMap = mutableMapOf() class TabListPlayer(var displayName: String, var internalName: String) + @SubscribeEvent + fun onWorldChange(event: WorldEvent.Load) { + uuidMap.clear() + tabListMap.clear() + } + @SubscribeEvent fun onChatPacket(event: PacketEvent.ReceiveEvent) { val packet = event.packet -- cgit