fix commands with trailing whitespaces (#3878)

fixes https://github.com/GeyserMC/Geyser/issues/3877
This commit is contained in:
chris 2023-06-16 04:17:29 +02:00 committed by GitHub
parent eecf84e87d
commit 6591332eb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -29,7 +29,6 @@ import org.cloudburstmc.protocol.bedrock.packet.CommandRequestPacket;
import org.geysermc.common.PlatformType;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.text.ChatColor;
import org.geysermc.geyser.translator.protocol.PacketTranslator;
import org.geysermc.geyser.translator.protocol.Translator;
import org.geysermc.geyser.translator.text.MessageTranslator;
@ -46,7 +45,9 @@ public class BedrockCommandRequestTranslator extends PacketTranslator<CommandReq
return;
}
session.sendCommand(command.substring(1));
// running commands via Bedrock's command select menu adds a trailing whitespace which Java doesn't like
// https://github.com/GeyserMC/Geyser/issues/3877
session.sendCommand(command.substring(1).stripTrailing());
}
}
}