File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
module/module-nms/src/main/kotlin/taboolib/module/nms Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import taboolib.common.platform.Awake
10
10
import taboolib.common.platform.Platform
11
11
import taboolib.common.platform.PlatformSide
12
12
import taboolib.common.platform.event.SubscribeEvent
13
+ import taboolib.common.platform.function.info
13
14
import taboolib.common.platform.function.isListened
14
15
import taboolib.common.platform.function.pluginId
15
16
import taboolib.common.platform.function.warning
@@ -108,9 +109,19 @@ object ChannelExecutor {
108
109
ConnectionGetter .instance.release(e.player.address ? : return )
109
110
}
110
111
111
- @Awake(LifeCycle .ENABLE )
112
+ @Awake(LifeCycle .ACTIVE )
112
113
private fun onEnable () {
113
- onlinePlayers.forEach { addPlayerChannel(it, it.address?.address ? : return @forEach) }
114
+ if (TabooLibCommon .isStopped()) {
115
+ return
116
+ }
117
+ onlinePlayers.forEach {
118
+ val address = it.address?.address
119
+ if (address == null ) {
120
+ warning(" Cannot get player address: ${it.name} (${it.address} )" )
121
+ return @forEach
122
+ }
123
+ addPlayerChannel(it, address)
124
+ }
114
125
}
115
126
116
127
@Awake(LifeCycle .DISABLE )
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ class ConnectionGetterImpl : ConnectionGetter() {
101
101
}
102
102
used
103
103
}
104
- dev(" Player connection ($address ) -> ${connection.address()} (init= $ init )" )
104
+ dev(" Player connection ($address ) -> ${connection.address()} (${ if ( init ) " init " else " get " } )" )
105
105
return connection
106
106
}
107
107
You can’t perform that action at this time.
0 commit comments