From d2a4f1a3296cc2a65ad96b06c856768655afd54c Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 13 May 2022 21:17:41 +0200 Subject: [PATCH] Small crash detector overflow fix --- SpigotCore_Main/src/de/steamwar/core/CrashDetector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpigotCore_Main/src/de/steamwar/core/CrashDetector.java b/SpigotCore_Main/src/de/steamwar/core/CrashDetector.java index be02e4f..76cd8a8 100644 --- a/SpigotCore_Main/src/de/steamwar/core/CrashDetector.java +++ b/SpigotCore_Main/src/de/steamwar/core/CrashDetector.java @@ -50,7 +50,7 @@ public class CrashDetector { private void run() { while (run) { long curTime = System.currentTimeMillis(); - if(curTime > lastTick.get() + TIMEOUT) { + if(curTime - TIMEOUT > lastTick.get()) { SWException.log(Bukkit.getServer().getVersion() + " server hung for " + (curTime - lastTick.get()) + "ms, ", Arrays.stream(mainThread.getStackTrace()).map(StackTraceElement::toString).collect(Collectors.joining("\n"))); lastTick.set(curTime); }