<commit_before>/*
 * Copyright  2014 - 2017 | Wurst-Imperium | All rights reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package net.wurstclient.features.commands;

import java.util.Iterator;

import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.util.StringUtils;
import net.wurstclient.altmanager.Alt;
import net.wurstclient.altmanager.screens.GuiAltList;
import net.wurstclient.compatibility.WMinecraft;
import net.wurstclient.files.ConfigFiles;
import net.wurstclient.utils.ChatUtils;

@Cmd.Info(
	description = "Adds a player or all players on a server to your alt list.",
	name = "addalt",
	syntax = {"<player>", "all"},
	help = "Commands/addalt")
public final class AddAltCmd extends Cmd
{
	@Override
	public void execute(String[] args) throws CmdError
	{
		if(args.length != 1)
			syntaxError();
		if(args[0].equals("all"))
		{
			int alts = 0;
			Iterator itr = mc.getConnection().getPlayerInfoMap().iterator();
			while(itr.hasNext())
			{
				NetworkPlayerInfo info = (NetworkPlayerInfo)itr.next();
				String crackedName =
					StringUtils.stripControlCodes(info.getPlayerNameForReal());
				if(crackedName.equals(WMinecraft.getPlayer().getName())
					|| crackedName.equals("Alexander01998") || GuiAltList.alts
						.contains(new Alt(crackedName, null, null)))
					continue;
				GuiAltList.alts.add(new Alt(crackedName, null, null));
				alts++;
			}
			if(alts == 1)
				ChatUtils.message("Added 1 alt to the alt list.");
			else
				ChatUtils.message("Added " + alts + " alts to the alt list.");
			GuiAltList.sortAlts();
			ConfigFiles.ALTS.save();
		}else if(!args[0].equals("Alexander01998"))
		{
			GuiAltList.alts.add(new Alt(args[0], null, null));
			GuiAltList.sortAlts();
			ConfigFiles.ALTS.save();
			ChatUtils.message("Added \"" + args[0] + "\" to the alt list.");
		}
	}
}<commit_msg>Update AddAltCmd<commit_after>/*
 * Copyright  2014 - 2017 | Wurst-Imperium | All rights reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package net.wurstclient.features.commands;

import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.util.StringUtils;
import net.wurstclient.altmanager.Alt;
import net.wurstclient.altmanager.screens.GuiAltList;
import net.wurstclient.compatibility.WMinecraft;
import net.wurstclient.files.ConfigFiles;
import net.wurstclient.utils.ChatUtils;

@Cmd.Info(
	description = "Adds a player or all players on a server to your alt list.",
	name = "addalt",
	syntax = {"<player>", "all"},
	help = "Commands/addalt")
public final class AddAltCmd extends Cmd
{
	@Override
	public void execute(String[] args) throws CmdError
	{
		if(args.length != 1)
			syntaxError();
		
		if(args[0].equals("all"))
		{
			int alts = 0;
			for(NetworkPlayerInfo info : WMinecraft.getConnection()
				.getPlayerInfoMap())
			{
				String name =
					StringUtils.stripControlCodes(info.getPlayerNameForReal());
				
				if(name.equals(WMinecraft.getPlayer().getName())
					|| name.equals("Alexander01998")
					|| GuiAltList.alts.contains(new Alt(name, null, null)))
					continue;
				
				GuiAltList.alts.add(new Alt(name, null, null));
				alts++;
			}
			
			if(alts == 1)
				ChatUtils.message("Added 1 alt.");
			else
				ChatUtils.message("Added " + alts + " alts.");
			
			GuiAltList.sortAlts();
			ConfigFiles.ALTS.save();
			
		}else if(!args[0].equals("Alexander01998"))
		{
			GuiAltList.alts.add(new Alt(args[0], null, null));
			
			GuiAltList.sortAlts();
			ConfigFiles.ALTS.save();
			
			ChatUtils.message("Added 1 alt.");
		}
	}
}
{'fraction_non_alphanumeric': 0.13826199740596629, 'fraction_numerical': 0.01556420233463035, 'mean_word_length': 3.850314465408805, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6609212', 'n_tokens_mistral': 1482, 'n_tokens_neox': 1286, 'n_words': 300}