From 5372f8440951719012f7e7325ef170b56abe55e6 Mon Sep 17 00:00:00 2001 From: jojo Date: Tue, 9 Feb 2021 21:07:24 +0100 Subject: [PATCH] Optimize CommandInfo --- .../bausystem/commands/CommandInfo.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandInfo.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandInfo.java index c3455c4..7783971 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandInfo.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandInfo.java @@ -56,18 +56,16 @@ public class CommandInfo implements CommandExecutor { } sender.sendMessage(membermessage.toString()); - if (TPSUtils.isWarping()) { - sender.sendMessage(BauSystem.PREFIX + "TPS:§e" + - " " + getTps(TPSWatcher.TPSType.ONE_SECOND) + - " " + getTps(TPSWatcher.TPSType.TEN_SECONDS)); - } else { - sender.sendMessage(BauSystem.PREFIX + "TPS:§e" + - " " + 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)); + StringBuilder tpsMessage = new StringBuilder(); + tpsMessage.append(BauSystem.PREFIX).append("TPS:§e"); + tpsMessage.append(" ").append(getTps(TPSWatcher.TPSType.ONE_SECOND)); + tpsMessage.append(" ").append(getTps(TPSWatcher.TPSType.TEN_SECONDS)); + if (!TPSUtils.isWarping()) { + tpsMessage.append(" ").append(TPSWatcher.getTPS(TPSWatcher.TPSType.ONE_MINUTE)); + tpsMessage.append(" ").append(TPSWatcher.getTPS(TPSWatcher.TPSType.FIVE_MINUTES)); + tpsMessage.append(" ").append(TPSWatcher.getTPS(TPSWatcher.TPSType.TEN_MINUTES)); } + sender.sendMessage(tpsMessage.toString()); return false; }