From 3d97188db0e24f5efef647b29db35cbe5cf20699 Mon Sep 17 00:00:00 2001 From: pop4959 Date: Thu, 9 Feb 2023 08:19:17 -0800 Subject: [PATCH] Add property to show scoreboard logs (#3539) * property to show scoreboard logs * cache system property --- .../java/org/geysermc/geyser/scoreboard/Scoreboard.java | 6 +++++- .../protocol/java/scoreboard/JavaSetScoreTranslator.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java b/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java index a7178ac8d..193b4b6ac 100644 --- a/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java +++ b/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java @@ -48,6 +48,8 @@ import java.util.concurrent.atomic.AtomicLong; import static org.geysermc.geyser.scoreboard.UpdateType.*; public final class Scoreboard { + private static final boolean SHOW_SCOREBOARD_LOGS = Boolean.parseBoolean(System.getProperty("Geyser.ShowScoreboardLogs", "true")); + private final GeyserSession session; private final GeyserLogger logger; @Getter @@ -134,7 +136,9 @@ public final class Scoreboard { public Team registerNewTeam(String teamName, String[] players) { Team team = teams.get(teamName); if (team != null) { - logger.info(GeyserLocale.getLocaleStringLog("geyser.network.translator.team.failed_overrides", teamName)); + if (SHOW_SCOREBOARD_LOGS) { + logger.info(GeyserLocale.getLocaleStringLog("geyser.network.translator.team.failed_overrides", teamName)); + } return team; } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaSetScoreTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaSetScoreTranslator.java index 41b978a86..7fa86b120 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaSetScoreTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaSetScoreTranslator.java @@ -44,6 +44,8 @@ import org.geysermc.geyser.translator.protocol.Translator; @Translator(packet = ClientboundSetScorePacket.class) public class JavaSetScoreTranslator extends PacketTranslator { + private static final boolean SHOW_SCOREBOARD_LOGS = Boolean.parseBoolean(System.getProperty("Geyser.ShowScoreboardLogs", "true")); + private final GeyserLogger logger; public JavaSetScoreTranslator() { @@ -58,7 +60,9 @@ public class JavaSetScoreTranslator extends PacketTranslator