From 12bd4718d22f844ff8f375e4e3595198a1199f47 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 3 Apr 2021 21:21:57 +0200 Subject: [PATCH] Boost CommandTPSLimiter to 60 --- .../steamwar/bausystem/commands/CommandTPSLimiter.java | 10 ++++++---- .../src/de/steamwar/bausystem/world/TPSUtils.java | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTPSLimiter.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTPSLimiter.java index 35101f5..1e2e01b 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTPSLimiter.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTPSLimiter.java @@ -63,7 +63,9 @@ public class CommandTPSLimiter extends SWCommand { public CommandTPSLimiter() { super("tpslimit"); if (TPSUtils.isWarpAllowed()) { - tabCompletions.addAll(Arrays.asList("21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40")); + for (int i = 20; i <= 60; i += 5) { + tabCompletions.add(i + ""); + } } } @@ -84,7 +86,7 @@ public class CommandTPSLimiter extends SWCommand { @Register public void valueCommand(Player p, double tpsLimitDouble) { if (!permissionCheck(p)) return; - if (tpsLimitDouble < 0.5 || tpsLimitDouble > (TPSUtils.isWarpAllowed() ? 40 : 20)) { + if (tpsLimitDouble < 0.5 || tpsLimitDouble > (TPSUtils.isWarpAllowed() ? 60 : 20)) { sendInvalidArgumentMessage(p); return; } @@ -117,7 +119,7 @@ public class CommandTPSLimiter extends SWCommand { } private void sendInvalidArgumentMessage(Player player) { - player.sendMessage(BauSystem.PREFIX + "§cNur Zahlen zwischen 0,5 und " + (TPSUtils.isWarpAllowed() ? 40 : 20) + ", und 'default' erlaubt."); + player.sendMessage(BauSystem.PREFIX + "§cNur Zahlen zwischen 0,5 und " + (TPSUtils.isWarpAllowed() ? 60 : 20) + ", und 'default' erlaubt."); } private void tpsLimiter() { @@ -166,7 +168,7 @@ public class CommandTPSLimiter extends SWCommand { public static void setTPS(double d) { if (d < 0.5) d = 0.5; - if (d > (TPSUtils.isWarpAllowed() ? 40 : 20)) d = (TPSUtils.isWarpAllowed() ? 40 : 20); + if (d > (TPSUtils.isWarpAllowed() ? 60 : 20)) d = (TPSUtils.isWarpAllowed() ? 60 : 20); if (instance != null) { currentTPSLimit = d; instance.tpsLimiter(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/TPSUtils.java b/BauSystem_Main/src/de/steamwar/bausystem/world/TPSUtils.java index 6ec2518..2a66c9d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/TPSUtils.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/TPSUtils.java @@ -55,7 +55,7 @@ public class TPSUtils { public static void setTPS(double tps) { double d = 50 - (50 / (tps / 20.0)); - nanoDOffset = Math.max(0, Math.min((long) (d * 1000000), 25000000)); + nanoDOffset = Math.max(0, Math.min((long) (d * 1000000), 37500000)); } public static boolean isWarpAllowed() { -- 2.39.5