style: use KT map function

This commit is contained in:
xtex 2023-07-26 16:45:51 +08:00
parent f9e6ffacc1
commit fa16d2172f
Signed by: xtex
GPG Key ID: B918086ED8045B91

View File

@ -14,7 +14,7 @@ object ProjectionShellMutex {
TickEvent.SERVER_POST.register { server -> TickEvent.SERVER_POST.register { server ->
val mutex = (server as ProjectionShellMutexAccessor).`quaedam$getProjectionShellMutex`() val mutex = (server as ProjectionShellMutexAccessor).`quaedam$getProjectionShellMutex`()
val currentTime = System.currentTimeMillis() val currentTime = System.currentTimeMillis()
mutex.forEach { pos, lock -> mutex.forEach { (pos, lock) ->
if (currentTime - lock.time > 60 * 1000) { if (currentTime - lock.time > 60 * 1000) {
mutex.remove(pos) mutex.remove(pos)
ProjectionShell.channel.sendToPlayer(lock.player, ClientboundPSHLockRevokePacket) ProjectionShell.channel.sendToPlayer(lock.player, ClientboundPSHLockRevokePacket)