address review

This commit is contained in:
onebeastchris 2024-05-29 22:25:44 +02:00
parent 5e25da1887
commit 04d9024664
2 changed files with 5 additions and 2 deletions

View file

@ -42,7 +42,7 @@ public class BedrockCommandRequestTranslator extends PacketTranslator<CommandReq
handleCommand(session, MessageTranslator.normalizeSpace(command).substring(1));
}
public static void handleCommand(GeyserSession session, String command) {
static void handleCommand(GeyserSession session, String command) {
if (!(session.getGeyser().getPlatformType() == PlatformType.STANDALONE
&& GeyserImpl.getInstance().commandManager().runCommand(session, command))) {
if (MessageTranslator.isTooLong(command, session)) {

View file

@ -64,6 +64,9 @@ public class MessageTranslator {
// Reset character
private static final String RESET = BASE + "r";
private static final char CHAR_NON_BREAKING_SPACE = 160;
private static final char CHAR_SPACE = 32;
static {
TEAM_COLORS.put(TeamColor.RESET, RESET);
@ -409,7 +412,7 @@ public class MessageTranslator {
whitespacesCount++;
} else {
startWhitespaces = false;
newChars[count++] = (actualChar == 160 ? 32 : actualChar);
newChars[count++] = (actualChar == CHAR_NON_BREAKING_SPACE ? CHAR_SPACE : actualChar);
whitespacesCount = 0;
}
}