feat: slow down PSH mutex checks
This commit is contained in:
parent
fa16d2172f
commit
30187548bb
@ -12,12 +12,14 @@ object ProjectionShellMutex {
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
TickEvent.SERVER_POST.register { server ->
|
TickEvent.SERVER_POST.register { server ->
|
||||||
val mutex = (server as ProjectionShellMutexAccessor).`quaedam$getProjectionShellMutex`()
|
if (server.tickCount and 8 == 0) {
|
||||||
val currentTime = System.currentTimeMillis()
|
val mutex = (server as ProjectionShellMutexAccessor).`quaedam$getProjectionShellMutex`()
|
||||||
mutex.forEach { (pos, lock) ->
|
val currentTime = System.currentTimeMillis()
|
||||||
if (currentTime - lock.time > 60 * 1000) {
|
mutex.forEach { (pos, lock) ->
|
||||||
mutex.remove(pos)
|
if (currentTime - lock.time > 60 * 1000) {
|
||||||
ProjectionShell.channel.sendToPlayer(lock.player, ClientboundPSHLockRevokePacket)
|
mutex.remove(pos)
|
||||||
|
ProjectionShell.channel.sendToPlayer(lock.player, ClientboundPSHLockRevokePacket)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user