From 072833f503b2dd1d3e8e5a6eae24a131c829cfb9 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 13 May 2023 11:09:28 +0200 Subject: [PATCH] Fix TPSLimit Freeze Signed-off-by: yoyosource --- .../bausystem/features/script/variables/Constants.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/variables/Constants.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/variables/Constants.java index e0ec0872..b14310b2 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/variables/Constants.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/variables/Constants.java @@ -2,6 +2,7 @@ package de.steamwar.bausystem.features.script.variables; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.features.loader.Loader; +import de.steamwar.bausystem.features.tpslimit.FreezeUtils; import de.steamwar.bausystem.features.tpslimit.TPSLimitUtils; import de.steamwar.bausystem.features.tpslimit.TPSUtils; import de.steamwar.bausystem.features.tracer.record.ActiveTracer; @@ -275,7 +276,10 @@ public class Constants { }); CONSTANTS.put("tps", player -> { - return new ConstantDoubleValue(TPSWatcher::getTPS); + return new ConstantDoubleValue(() -> { + if (FreezeUtils.isFrozen()) return 0.0; + return TPSWatcher.getTPS(); + }); }); CONSTANTS.put("tps_limit", player -> { return new ConstantDoubleValue(TPSLimitUtils::getCurrentTPSLimit);