diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/libs/TpsLib.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/libs/TpsLib.java index 1435aa44..6b9435e1 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/libs/TpsLib.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/libs/TpsLib.java @@ -51,7 +51,7 @@ public class TpsLib implements LuaLib { tpsLib.set("fiveMinute", getter(() -> TPSWatcher.getTPS(TPSWatcher.TPSType.FIVE_MINUTES))); tpsLib.set("tenMinute", getter(() -> TPSWatcher.getTPS(TPSWatcher.TPSType.TEN_MINUTES))); tpsLib.set("current", getter(TPSWatcher::getTPS)); - tpsLib.set("limit", getter(tpsSystem::getCurrentTPSLimit)); + tpsLib.set("limit", getter(TPSSystem::getCurrentTPSLimit)); return tpsLib; } } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSCommand.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSCommand.java index 1b5b51eb..c1d09c63 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSCommand.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSCommand.java @@ -42,16 +42,16 @@ public class TPSCommand extends SWCommand { public void genericCommand(Player p, String... args) { BauSystem.MESSAGE.sendPrefixless("OTHER_TPS_HEAD", p); BauSystem.MESSAGE.sendPrefixless("OTHER_TPS_MESSAGE", p, - TPSWatcher.getTPS(TPSWatcher.TPSType.ONE_SECOND), - TPSWatcher.getTPS(TPSWatcher.TPSType.TEN_SECONDS), - TPSWatcher.getTPS(TPSWatcher.TPSType.ONE_MINUTE), - TPSWatcher.getTPS(TPSWatcher.TPSType.FIVE_MINUTES), - TPSWatcher.getTPS(TPSWatcher.TPSType.TEN_MINUTES) + TPSWatcher.getTPSUnlimited(TPSWatcher.TPSType.ONE_SECOND), + TPSWatcher.getTPSUnlimited(TPSWatcher.TPSType.TEN_SECONDS), + TPSWatcher.getTPSUnlimited(TPSWatcher.TPSType.ONE_MINUTE), + TPSWatcher.getTPSUnlimited(TPSWatcher.TPSType.FIVE_MINUTES), + TPSWatcher.getTPSUnlimited(TPSWatcher.TPSType.TEN_MINUTES) ); } @Register public void genericCommand(Player p, TPSWatcher.TPSType type) { - BauSystem.MESSAGE.sendPrefixless("OTHER_TPS_SINGLE", p, tpsSystem.getTPS(type)); + BauSystem.MESSAGE.sendPrefixless("OTHER_TPS_SINGLE", p, TPSWatcher.getTPSUnlimited(type)); } } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSSystem.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSSystem.java index 1e25ff18..ac393e57 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSSystem.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSSystem.java @@ -56,11 +56,7 @@ import java.util.Arrays; public class TPSSystem implements Listener { @Getter - private double currentTPSLimit = 20; - - public double getTPS(TPSWatcher.TPSType tpsType) { - return TPSWatcher.getTPSUnlimited(tpsType); - } + private static double currentTPSLimit = 20; public TPSSystem() { if (TPSFreezeUtils.isCanFreeze()) { @@ -338,26 +334,26 @@ public class TPSSystem implements Listener { } else if (TPSFreezeUtils.frozen()) { return "§e" + BauSystem.MESSAGE.parse("SCOREBOARD_TPS", p) + "§8: " + BauSystem.MESSAGE.parse("SCOREBOARD_TPS_FROZEN", p); } else { - return "§e" + BauSystem.MESSAGE.parse("SCOREBOARD_TPS", p) + "§8: " + tpsColor() + tpsSystem.getTPS(TPSWatcher.TPSType.ONE_SECOND) + tpsLimit(); + return "§e" + BauSystem.MESSAGE.parse("SCOREBOARD_TPS", p) + "§8: " + tpsColor() + TPSWatcher.getTPSUnlimited(TPSWatcher.TPSType.ONE_SECOND) + tpsLimit(); } } private String tpsColor() { - double tps = tpsSystem.getTPS(TPSWatcher.TPSType.ONE_SECOND); - if (tps > tpsSystem.getCurrentTPSLimit() * 0.9) { + double tps = TPSWatcher.getTPSUnlimited(TPSWatcher.TPSType.ONE_SECOND); + if (tps > TPSSystem.getCurrentTPSLimit() * 0.9) { return "§a"; } - if (tps > tpsSystem.getCurrentTPSLimit() * 0.5) { + if (tps > TPSSystem.getCurrentTPSLimit() * 0.5) { return "§e"; } return "§c"; } private String tpsLimit() { - if (tpsSystem.getCurrentTPSLimit() == 20) { + if (TPSSystem.getCurrentTPSLimit() == 20) { return ""; } - return "§8/§7" + tpsSystem.getCurrentTPSLimit(); + return "§8/§7" + TPSSystem.getCurrentTPSLimit(); } }