diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-26 18:39:21 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-26 18:39:21 +0100 |
commit | fca3cf865a62b1cd2c9d272e627e5c206954b520 (patch) | |
tree | 32f7f8b8ea91a594c13509d51d71223d1cc8f671 | |
parent | eb69c8b47087037388ccad6d44955a75746c0e2e (diff) | |
download | skyhanni-fca3cf865a62b1cd2c9d272e627e5c206954b520.tar.gz skyhanni-fca3cf865a62b1cd2c9d272e627e5c206954b520.tar.bz2 skyhanni-fca3cf865a62b1cd2c9d272e627e5c206954b520.zip |
Clearing tab list data after world switch. this can semi-fix the visitor timer stuck bug by switching worlds.
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt | 8 |
1 files changed, 7 insertions, 1 deletions
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,17 +4,23 @@ 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<UUID, TabListPlayer>() private val tabListMap = mutableMapOf<TabListPlayer, String>() 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 if (packet is S38PacketPlayerListItem) { |