Skip to content

Commit 4e81b59

Browse files
fix: publish TabEntryRemoveRedisEvent on server switch in ConnectionListener to ensure proper tablist entry cleanup
1 parent a9b1233 commit 4e81b59

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

surf-tab-velocity/src/main/kotlin/dev/slne/surf/tab/velocity/listener/ConnectionListener.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import kotlin.jvm.optionals.getOrNull
1515
class ConnectionListener {
1616
@Subscribe
1717
fun onPostConnect(event: ServerPostConnectEvent) {
18+
event.previousServer?.let {
19+
redisApi.publishEvent(TabEntryRemoveRedisEvent(event.player.uniqueId, it))
20+
}
21+
1822
plugin.proxy.scheduler.buildTask(plugin, Runnable {
1923
handleJoin(event.player)
2024
}).delay(750, TimeUnit.MILLISECONDS).schedule()

0 commit comments

Comments
 (0)