diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/GlobalEventHandler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/GlobalEventHandler.kt index db22a8596..d0986292a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/GlobalEventHandler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/GlobalEventHandler.kt @@ -27,7 +27,7 @@ private val preServerTickTimers = TimerQueue() private val postServerTickTimers = TimerQueue() fun addPreTickTimer(inTicks: Int, callback: Runnable): TimerQueue.Timer? { - if (SERVER_IS_LIVE) { + if (!SERVER_IS_LIVE) { LOGGER.error("Refusing to add timer $callback in ticks $inTicks while server is dying", IllegalStateException("Server is stopping")) return null } @@ -36,7 +36,7 @@ fun addPreTickTimer(inTicks: Int, callback: Runnable): TimerQueue.Timer? { } fun addPostTickTimer(inTicks: Int, callback: Runnable): TimerQueue.Timer? { - if (SERVER_IS_LIVE) { + if (!SERVER_IS_LIVE) { LOGGER.error("Refusing to add ticker $callback in ticks $inTicks while server is dying", IllegalStateException("Server is stopping")) return null }