aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/events/ServerConnectedEvent.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/events/ServerConnectedEvent.kt')
-rw-r--r--src/main/kotlin/events/ServerConnectedEvent.kt18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/kotlin/events/ServerConnectedEvent.kt b/src/main/kotlin/events/ServerConnectedEvent.kt
new file mode 100644
index 0000000..26897f2
--- /dev/null
+++ b/src/main/kotlin/events/ServerConnectedEvent.kt
@@ -0,0 +1,18 @@
+package moe.nea.firmament.events
+
+import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents
+import net.minecraft.client.MinecraftClient
+import net.minecraft.client.network.ClientPlayNetworkHandler
+import net.minecraft.network.ClientConnection
+
+data class ServerConnectedEvent(
+ val connection: ClientConnection
+) : FirmamentEvent() {
+ companion object : FirmamentEventBus<ServerConnectedEvent>() {
+ init {
+ ClientPlayConnectionEvents.INIT.register(ClientPlayConnectionEvents.Init { clientPlayNetworkHandler: ClientPlayNetworkHandler, minecraftClient: MinecraftClient ->
+ publishSync(ServerConnectedEvent(clientPlayNetworkHandler.connection))
+ })
+ }
+ }
+}