Skip to content

Commit

Permalink
local connection: add player to tab list
Browse files Browse the repository at this point in the history
  • Loading branch information
Bixilon committed Aug 9, 2024
1 parent eb9c261 commit 3b391b1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/de/bixilon/minosoft/local/LocalConnection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ import de.bixilon.kutil.observer.DataObserver.Companion.observed
import de.bixilon.minosoft.data.abilities.Gamemodes
import de.bixilon.minosoft.data.chat.message.SimpleChatMessage
import de.bixilon.minosoft.data.chat.type.DefaultMessageTypes
import de.bixilon.minosoft.data.entities.entities.player.additional.AdditionalDataUpdate
import de.bixilon.minosoft.data.entities.entities.player.local.Abilities
import de.bixilon.minosoft.data.registries.dimension.DimensionProperties
import de.bixilon.minosoft.data.registries.identified.ResourceLocation
import de.bixilon.minosoft.data.text.ChatComponent
import de.bixilon.minosoft.local.generator.ChunkGenerator
import de.bixilon.minosoft.local.storage.WorldStorage
import de.bixilon.minosoft.modding.event.events.DimensionChangeEvent
import de.bixilon.minosoft.modding.event.events.TabListEntryChangeEvent
import de.bixilon.minosoft.modding.event.events.chat.ChatMessageEvent
import de.bixilon.minosoft.protocol.ServerConnection
import de.bixilon.minosoft.protocol.network.session.Session
Expand Down Expand Up @@ -78,6 +80,13 @@ class LocalConnection(
session.events.fire(DimensionChangeEvent(session))
session.state = PlaySessionStates.SPAWNING

val additional = session.player.additional

session.tabList.uuid[session.player.uuid] = additional
session.tabList.name[session.player.additional.name] = additional

session.events.fire(TabListEntryChangeEvent(session, mapOf(session.player.uuid to AdditionalDataUpdate())))

session.player.physics.forceTeleport(Vec3d(0, 20, 0))
session.state = PlaySessionStates.PLAYING

Expand Down

0 comments on commit 3b391b1

Please sign in to comment.