Skip to content

Commit

Permalink
Add /cnote to the list of commands to not send to the server
Browse files Browse the repository at this point in the history
  • Loading branch information
Earthcomputer committed Aug 27, 2023
1 parent 14665f5 commit 12e4551
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class ClientCommands implements ClientModInitializer {
public static Path configDir;
private static final Set<String> clientcommandsCommands = new HashSet<>();
public static final Identifier COMMAND_EXECUTION_PACKET_ID = new Identifier("clientcommands", "command_execution");
private static final Set<String> COMMANDS_TO_NOT_SEND_TO_SERVER = Set.of("cwe", "cnote"); // could contain private information

public static final boolean SCRAMBLE_WINDOW_TITLE = Util.make(() -> {
String playerUUID = MinecraftClient.getInstance().getSession().getProfile().getId().toString();
Expand Down Expand Up @@ -87,7 +88,7 @@ public static void sendCommandExecutionToServer(String command) {
StringReader reader = new StringReader(command);
reader.skipWhitespace();
String theCommand = reader.readUnquotedString();
if (clientcommandsCommands.contains(theCommand) && !"cwe".equals(theCommand)) { // avoid sending end-to-end encrypted messages
if (clientcommandsCommands.contains(theCommand) && !COMMANDS_TO_NOT_SEND_TO_SERVER.contains(theCommand)) {
if (ClientPlayNetworking.canSend(COMMAND_EXECUTION_PACKET_ID)) {
PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
buf.writeString(command);
Expand Down

0 comments on commit 12e4551

Please sign in to comment.