From 3e0cb28a63b6e303ac1421f7136b825f6a91558f Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+DoctorMacc@users.noreply.github.com> Date: Fri, 10 Jul 2020 14:14:54 -0400 Subject: [PATCH] Fix scoreboard prefix/suffix translation errors (#929) Uses getTranslatedBedrockMessage() instead of getBedrockMessage(). Fixes #923. --- .../translators/java/scoreboard/JavaTeamTranslator.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaTeamTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaTeamTranslator.java index f6ae4d6fe..f1eb21011 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaTeamTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaTeamTranslator.java @@ -54,15 +54,15 @@ public class JavaTeamTranslator extends PacketTranslator { scoreboard.registerNewTeam(packet.getTeamName(), toPlayerSet(packet.getPlayers())) .setName(MessageUtils.getBedrockMessage(packet.getDisplayName())) .setColor(packet.getColor()) - .setPrefix(MessageUtils.getBedrockMessage(packet.getPrefix())) - .setSuffix(MessageUtils.getBedrockMessage(packet.getSuffix())); + .setPrefix(MessageUtils.getTranslatedBedrockMessage(packet.getPrefix(), session.getClientData().getLanguageCode())) + .setSuffix(MessageUtils.getTranslatedBedrockMessage(packet.getSuffix(), session.getClientData().getLanguageCode())); break; case UPDATE: if (team != null) { team.setName(MessageUtils.getBedrockMessage(packet.getDisplayName())) .setColor(packet.getColor()) - .setPrefix(MessageUtils.getBedrockMessage(packet.getPrefix())) - .setSuffix(MessageUtils.getBedrockMessage(packet.getSuffix())) + .setPrefix(MessageUtils.getTranslatedBedrockMessage(packet.getPrefix(), session.getClientData().getLanguageCode())) + .setSuffix(MessageUtils.getTranslatedBedrockMessage(packet.getSuffix(), session.getClientData().getLanguageCode())) .setUpdateType(UpdateType.UPDATE); } else { GeyserConnector.getInstance().getLogger().error(LanguageUtils.getLocaleStringLog("geyser.network.translator.team.failed_not_registered", packet.getAction(), packet.getTeamName()));