diff options
Diffstat (limited to 'src')
-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) { |