<commit_before>package com.ForgeEssentials.chat.commands;

import java.util.HashMap;
import java.util.Map;

import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;

import com.ForgeEssentials.core.commands.ForgeEssentialsCommandBase;
import com.ForgeEssentials.permission.PermissionsAPI;
import com.ForgeEssentials.permission.query.PermQueryPlayer;
import com.ForgeEssentials.util.FEChatFormatCodes;
import com.ForgeEssentials.util.FunctionHelper;
import com.ForgeEssentials.util.Localization;
import com.ForgeEssentials.util.OutputHandler;

public class CommandMsg extends ForgeEssentialsCommandBase
{
	private static Map<String, String> playerReply;
	
	public CommandMsg()
	{
		super();
		playerReply = new HashMap<String, String>();
	}
	@Override
	public String getCommandName()
	{
		return "msg";
	}

	@Override
	public void processCommandPlayer(EntityPlayer sender, String[] args)
	{
		if(args.length == 0)
		{
			OutputHandler.chatError(sender, Localization.get(Localization.ERROR_BADSYNTAX) + "/msg <player> <message>");
			return;
		}
		if(args.length == 1)
		{
			OutputHandler.chatError(sender, Localization.get(Localization.ERROR_BADSYNTAX) + "/msg <player> <message>");
			return;
		}
		if(args.length > 1)
		{
			if(args[0].equalsIgnoreCase("server") || args[0].equalsIgnoreCase("console"))
			{
				if(playerReply.containsKey(sender.getCommandSenderName()))
					playerReply.remove(sender.getCommandSenderName());
				if(playerReply.containsKey("server"))
					playerReply.remove("server");
				playerReply.put(sender.getCommandSenderName(), "server");
				playerReply.put("server", sender.getCommandSenderName());
				String senderMessage = FEChatFormatCodes.GOLD + "[ me -> " + FEChatFormatCodes.PURPLE + "Server" + FEChatFormatCodes.GOLD + "] " + FEChatFormatCodes.GREY;<commit_msg>Added aliases "whisper" and "tell" to /msg.<commit_after>package com.ForgeEssentials.chat.commands;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;

import com.ForgeEssentials.core.commands.ForgeEssentialsCommandBase;
import com.ForgeEssentials.permission.PermissionsAPI;
import com.ForgeEssentials.permission.query.PermQueryPlayer;
import com.ForgeEssentials.util.FEChatFormatCodes;
import com.ForgeEssentials.util.FunctionHelper;
import com.ForgeEssentials.util.Localization;
import com.ForgeEssentials.util.OutputHandler;

public class CommandMsg extends ForgeEssentialsCommandBase
{
	private static Map<String, String> playerReply;
	private List<String> aliasList;
	
	public CommandMsg()
	{
		super();
		playerReply = new HashMap<String, String>();
		aliasList = new LinkedList<String>();
		aliasList.add("tell");
		aliasList.add("whipser");
	}
	
	@Override
	public String getCommandName()
	{
		return "msg";
	}
	
	@Override
	public List getCommandAliases()
	{
		return aliasList;
	}

	@Override
	public void processCommandPlayer(EntityPlayer sender, String[] args)
	{
		if(args.length == 0)
		{
			OutputHandler.chatError(sender, Localization.get(Localization.ERROR_BADSYNTAX) + "/msg <player> <message>");
			return;
		}
		if(args.length == 1)
		{
			OutputHandler.chatError(sender, Localization.get(Localization.ERROR_BADSYNTAX) + "/msg <player> <message>");
			return;
		}
		if(args.length > 1)
		{
			if(args[0].equalsIgnoreCase("server") || args[0].equalsIgnoreCase("console"))
			{
				if(playerReply.containsKey(sender.getCommandSenderName()))
					playerReply.remove(sender.getCommandSenderName());
				if(playerReply.containsKey("server"))
					playerReply.remove("server");
				playerReply.put(sender.getCommandSenderName(), "server");
				playerReply.put("server", sender.getCommandSenderName());
				String senderMessage = FEChatFormatCodes.GOLD + "[ me -> " + FEChatFormatCodes.PURPLE + "Server" + FEChatFormatCodes.GOLD + "] " + FEChatFormatCodes.GREY;
{'fraction_non_alphanumeric': 0.12463837994214079, 'fraction_numerical': 0.0024108003857280617, 'mean_word_length': 5.681159420289855, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, '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': '4940486', 'n_tokens_mistral': 1422, 'n_tokens_neox': 1312, 'n_words': 211}