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