From 7434d9cea312d95bcbc12983a83721a7984bb63d Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 1 Oct 2021 20:19:52 +0200 Subject: [PATCH] Fix BauScoreboard Signed-off-by: yoyosource --- BauSystem_Main/src/BauSystem.properties | 1 - .../features/world/BauScoreboard.java | 22 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 0a846560..e8680519 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -38,7 +38,6 @@ SCOREBOARD_LOADER = Loader SCOREBOARD_TPS = TPS SCOREBOARD_TRACE_TICKS = Ticks -SCOREBOARD_TRACE_TNT-COUNT = Anzahl TNT # Flags FLAG_COLOR = Color diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/BauScoreboard.java b/BauSystem_Main/src/de/steamwar/bausystem/features/world/BauScoreboard.java index 7ba3545a..31a86dc2 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/BauScoreboard.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/world/BauScoreboard.java @@ -40,7 +40,13 @@ public class BauScoreboard implements Listener { @Override public String getTitle() { - return "§eSteam§8War"; + // ■ + Region region = Region.getRegion(player.getLocation()); + if (GlobalRegion.getInstance() != region) { + return "§eSteam§8War"; + } + String colorCode = BauSystem.MESSAGE.parse(region.get(Flag.COLOR).getChatValue(), player).substring(0, 2); + return colorCode + "■ §eSteam§8War " + colorCode + "■"; } }); } @@ -68,16 +74,16 @@ public class BauScoreboard implements Listener { } strings.add("§3"); - strings.add(colorCode + BauSystem.MESSAGE.parse("SCOREBOARD_TRACE", p) + "§8: " + BauSystem.MESSAGE.parse(RecordStateMachine.getRecordStatus().getName(), p)); + StringBuilder st = new StringBuilder(); + st.append(colorCode).append(BauSystem.MESSAGE.parse("SCOREBOARD_TRACE", p)).append("§8: ").append(BauSystem.MESSAGE.parse(RecordStateMachine.getRecordStatus().getName(), p)); + if (RecordStateMachine.getRecordStatus().isTracing()) { + st.append(" §8| §e").append(traceTicks()).append(" §7").append(BauSystem.MESSAGE.parse("SCOREBOARD_TRACE_TICKS", p)); + } + strings.add(st.toString()); + Loader loader = Loader.getLoader(p); strings.add(colorCode + BauSystem.MESSAGE.parse("SCOREBOARD_LOADER", p) + "§8: " + BauSystem.MESSAGE.parse(loader != null ? loader.getStage().getChatValue() : "LOADER_OFF", p)); - if (RecordStateMachine.getRecordStatus().isTracing()) { - strings.add("§4"); - strings.add(colorCode + BauSystem.MESSAGE.parse("SCOREBOARD_TRACE_TICKS", p) + "§8: §7" + traceTicks()); - strings.add(colorCode + BauSystem.MESSAGE.parse("SCOREBOARD_TRACE_TNT-COUNT", p) + "§8: §7" + RecordStateMachine.size()); - } - strings.add("§5"); strings.add(colorCode + BauSystem.MESSAGE.parse("SCOREBOARD_TPS", p) + "§8 " + tpsColor() + TPSWarpUtils.getTps(TPSWatcher.TPSType.ONE_SECOND) + tpsLimit());