<commit_before>package me.deftware.client.framework.command.commands;

import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import me.deftware.client.framework.command.CommandBuilder;
import me.deftware.client.framework.command.CommandResult;
import me.deftware.client.framework.command.EMCModCommand;
import me.deftware.client.framework.main.Bootstrap;
import me.deftware.client.framework.maps.SettingsMap;
import me.deftware.client.framework.wrappers.IChat;

public class CommandTrigger extends EMCModCommand {

	@Override
	public CommandBuilder getCommandBuilder() {
		return new CommandBuilder().set((LiteralArgumentBuilder) LiteralArgumentBuilder.literal("trigger")
				.then(
						LiteralArgumentBuilder.literal("set")
								.then(
										RequiredArgumentBuilder.argument("prefix", StringArgumentType.string())
												.executes(c -> {
													CommandResult r = new CommandResult(c);
													if(r.getString("prefix").length() > 1)
													{
														IChat.sendClientMessage("Command trigger has to be a single character!");
														IChat.sendClientMessage("No configuration had been altered");
													}
													else {
														SettingsMap.update(SettingsMap.MapKeys.EMC_SETTINGS, "COMMAND_TRIGGER", r.getString("prefix"));
														Bootstrap.EMCSettings.saveString("commandtrigger", r.getString("prefix"));
														IChat.sendClientMessage("Set command trigger to \"" + r.getString("prefix") + "\"");
													}
													return 1;
												})
								)
				)
				.then(
						LiteralArgumentBuilder.literal("restore")
								.executes(c -> {
									//CommandResult r = new CommandResult(c);
									SettingsMap.update(SettingsMap.MapKeys.EMC_SETTINGS, "COMMAND_TRIGGER", ".");
									Bootstrap.EMCSettings.saveString("commandtrigger", ".");
									IChat.sendClientMessage("Command trigger had been reset to \".\" (single dot)");
									return 1;
								})
				)
		);
	}

}
<commit_msg>Prevented user from using multiple characters as a trigger for commands Matching "Style of code"<commit_after>package me.deftware.client.framework.command.commands;

import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import me.deftware.client.framework.command.CommandBuilder;
import me.deftware.client.framework.command.CommandResult;
import me.deftware.client.framework.command.EMCModCommand;
import me.deftware.client.framework.main.Bootstrap;
import me.deftware.client.framework.maps.SettingsMap;
import me.deftware.client.framework.wrappers.IChat;

public class CommandTrigger extends EMCModCommand {

	@Override
	public CommandBuilder getCommandBuilder() {
		return new CommandBuilder().set((LiteralArgumentBuilder) LiteralArgumentBuilder.literal("trigger")
				.then(
						LiteralArgumentBuilder.literal("set")
								.then(
										RequiredArgumentBuilder.argument("prefix", StringArgumentType.string())
												.executes(c -> {
													CommandResult r = new CommandResult(c);
													if(r.getString("prefix").length() > 1) {
														IChat.sendClientMessage("Command trigger has to be a single character!");
														IChat.sendClientMessage("No configuration had been altered");
													}
													else {
														SettingsMap.update(SettingsMap.MapKeys.EMC_SETTINGS, "COMMAND_TRIGGER", r.getString("prefix"));
														Bootstrap.EMCSettings.saveString("commandtrigger", r.getString("prefix"));
														IChat.sendClientMessage("Set command trigger to \"" + r.getString("prefix") + "\"");
													}
													return 1;
												})
								)
				)
				.then(
						LiteralArgumentBuilder.literal("restore")
								.executes(c -> {
									//CommandResult r = new CommandResult(c);
									SettingsMap.update(SettingsMap.MapKeys.EMC_SETTINGS, "COMMAND_TRIGGER", ".");
									Bootstrap.EMCSettings.saveString("commandtrigger", ".");
									IChat.sendClientMessage("Command trigger had been reset to \".\" (single dot)");
									return 1;
								})
				)
		);
	}

}

{'fraction_non_alphanumeric': 0.11563670411985019, 'fraction_numerical': 0.0014044943820224719, 'mean_word_length': 3.1165703275529864, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2146991', 'n_tokens_mistral': 1698, 'n_tokens_neox': 1176, 'n_words': 196}