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 6e0867ddc3..3d3bfb48d9 100644 --- a/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java +++ b/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java @@ -178,7 +178,7 @@ public void registerNewTeam( Team team = teams.get(teamName); if (team != null) { if (SHOW_SCOREBOARD_LOGS) { - logger.info(GeyserLocale.getLocaleStringLog("geyser.network.translator.team.failed_overrides", teamName)); + logger.info("Ignoring team %s for %s. It overrides without removing old team.".formatted(teamName, session.javaUsername())); } return; } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaResetScorePacket.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaResetScorePacket.java index cf688bbfd1..72dcd40621 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaResetScorePacket.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaResetScorePacket.java @@ -25,6 +25,8 @@ package org.geysermc.geyser.translator.protocol.java.scoreboard; +import org.geysermc.geyser.GeyserImpl; +import org.geysermc.geyser.GeyserLogger; import org.geysermc.geyser.scoreboard.Objective; import org.geysermc.geyser.scoreboard.Scoreboard; import org.geysermc.geyser.scoreboard.ScoreboardUpdater; @@ -36,6 +38,10 @@ @Translator(packet = ClientboundResetScorePacket.class) public class JavaResetScorePacket extends PacketTranslator { + private static final boolean SHOW_SCOREBOARD_LOGS = Boolean.parseBoolean(System.getProperty("Geyser.ShowScoreboardLogs", "true")); + + private final GeyserLogger logger = GeyserImpl.getInstance().getLogger(); + @Override public void translate(GeyserSession session, ClientboundResetScorePacket packet) { WorldCache worldCache = session.getWorldCache(); @@ -47,6 +53,14 @@ public void translate(GeyserSession session, ClientboundResetScorePacket packet) scoreboard.resetPlayerScores(packet.getOwner()); } else { Objective objective = scoreboard.getObjective(packet.getObjective()); + if (objective == null) { + if (SHOW_SCOREBOARD_LOGS) { + logger.info(String.format( + "Tried to reset score %s for %s without the existence of its requested objective %s", + packet.getOwner(), session.javaUsername(), packet.getObjective())); + } + return; + } objective.removeScore(packet.getOwner()); } 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 989f0f2cb7..c7159041be 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 @@ -32,7 +32,6 @@ import org.geysermc.geyser.scoreboard.ScoreboardUpdater; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.WorldCache; -import org.geysermc.geyser.text.GeyserLocale; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.scoreboard.ClientboundSetScorePacket; @@ -41,11 +40,7 @@ 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() { - logger = GeyserImpl.getInstance().getLogger(); - } + private final GeyserLogger logger = GeyserImpl.getInstance().getLogger(); @Override public void translate(GeyserSession session, ClientboundSetScorePacket packet) { @@ -56,7 +51,9 @@ public void translate(GeyserSession session, ClientboundSetScorePacket packet) { Objective objective = scoreboard.getObjective(packet.getObjective()); if (objective == null) { if (SHOW_SCOREBOARD_LOGS) { - logger.info(GeyserLocale.getLocaleStringLog("geyser.network.translator.score.failed_objective", packet.getObjective())); + logger.info(String.format( + "Tried to update score %s for %s without the existence of its requested objective %s", + packet.getOwner(), session.javaUsername(), packet.getObjective())); } return; }