<commit_before>package com.censoredsoftware.demigods.engine.command;

import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

import org.apache.commons.lang.StringUtils;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import com.censoredsoftware.censoredlib.helper.WrappedCommand;
import com.censoredsoftware.censoredlib.language.Symbol;
import com.censoredsoftware.censoredlib.util.Maps2;
import com.censoredsoftware.censoredlib.util.Strings;
import com.censoredsoftware.censoredlib.util.Titles;
import com.censoredsoftware.demigods.engine.Demigods;
import com.censoredsoftware.demigods.engine.battle.Battle;
import com.censoredsoftware.demigods.engine.data.TributeManager;
import com.censoredsoftware.demigods.engine.deity.Alliance;
import com.censoredsoftware.demigods.engine.language.Translation;
import com.censoredsoftware.demigods.engine.player.DCharacter;
import com.censoredsoftware.demigods.engine.player.DPlayer;
import com.censoredsoftware.demigods.engine.util.Messages;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;

public class GeneralCommands extends WrappedCommand
{
	public GeneralCommands()
	{
		super(Demigods.PLUGIN, false);
	}

	@Override
	public Set<String> getCommands()
	{
		return Sets.newHashSet("check", "owner", "binds", "leaderboard", "alliance", "values", "names");
	}

	@Override
	public boolean processCommand(CommandSender sender, Command command, String[] args)
	{
		if(command.getName().equalsIgnoreCase("check")) return check(sender);
		else if(command.getName().equalsIgnoreCase("owner")) return owner(sender, args);
		else if(command.getName().equalsIgnoreCase("alliance")) return alliance(sender, args);
		else if(command.getName().equalsIgnoreCase("binds")) return binds(sender);
		else if(command.getName().equalsIgnoreCase("leaderboard")) return leaderboard(sender);
		else if(command.getName().equalsIgnoreCase("tributes")) return tributes(sender);
		else if(command.getName().equalsIgnoreCase("names")) return names(sender);
		return false;
	}

	private boolean check(CommandSender sender)
	{
		Player player = (Player) sender;
		DCharacter character = DPlayer.Util.getPlayer(player).getCurrent();

		if(character == null)
		{
			player.sendMessage(ChatColor.RED + "You are nothing but a mortal. You have no worthy statistics.");
			return true;
		}

		// Define variables
		int kills = character.getKillCount();
		int deaths = character.getDeathCount();
		String charName = character.getName();
		String deity = character.getDeity().getName();
		Alliance alliance = character.getAlliance();

		int favor = character.getMeta().getFavor();
		int maxFavor = character.getMeta().getMaxFavor();
		int ascensions = character.getMeta().getAscensions();
		int skillPoints = character.getMeta().getSkillPoints();
		ChatColor deityColor = character.getDeity().getColor();
		ChatColor favorColor = Strings.getColor(character.getMeta().getFavor(), character.getMeta().getMaxFavor());

		// Set player status
		String status = ChatColor.YELLOW + "Ready.";
		if(!character.canPvp()) status = ChatColor.DARK_AQUA + "Safe.";
		else if(Battle.Util.isInBattle(character)) status = ChatColor.GOLD + "In battle.";

		// Send the user their info via chat
		Messages.tagged(sender, "Player Check");

		sender.sendMessage(ChatColor.GRAY + " " + Symbol.RIGHTWARD_ARROW + " " + ChatColor.RESET + "Character: " + deityColor + charName);
		sender.sendMessage(ChatColor.GRAY + " " + Symbol.RIGHTWARD_ARROW + " " + ChatColor.RESET + "Deity: " + deityColor + deity + ChatColor.WHITE + " of the " + ChatColor.GOLD + alliance.getName() + "s");
		sender.sendMessage(ChatColor.GRAY + " " + Symbol.RIGHTWARD_ARROW + " " + ChatColor.RESET + "Favor: " + favorColor + favor + ChatColor.GRAY + " (of " + ChatColor.GREEN + maxFavor + ChatColor.GRAY + ")");
		sender.sendMessage(ChatColor.GRAY + " " + Symbol.RIGHTWARD_ARROW + " " + ChatColor.RESET + "Ascensions: " + ChatColor.GREEN + ascensions);
		sender.sendMessage(ChatColor.GRAY + " " + Symbol.RIGHTWARD_ARROW + " " + ChatColor.RESET + "Available Skill Points: " + ChatColor.GREEN + skillPoints);
		sender.sendMessage(ChatColor.GRAY + " " + Symbol.RIGHTWARD_ARROW + " " + ChatColor.RESET + "Kills: " + ChatColor.GREEN + kills + ChatColor.WHITE + " / Deaths: " + ChatColor.RED + deaths + ChatColor.GRAY + " (Ratio: " + (deaths == 0 ? kills : (Math.round(kills / deaths * 100.0) / 100.0) + ")"));
		sender.sendMessage(ChatColor.GRAY + " " + Symbol.RIGHTWARD_ARROW + " " + ChatColor.RESET + "Status: " + status);

		return true;
	}

	private boolean owner(CommandSender sender, String[] args)
	{
		// Check permissions
		if(!sender.hasPermission("demigods.basic")) return Messages.noPermission(sender);

		Player player = (Player) sender;
		if(args.length < 1)
		{
			player.sendMessage(ChatColor.RED + "You must select a character.");
			player.sendMessage(ChatColor.RED + "/owner <character>");
			return true;
		}
		DCharacter charToCheck = DCharacter.Util.getCharacterByName(args[0]);
		if(charToCheck == null) player.sendMessage(ChatColor.RED + "That character doesn't exist.");
		else player.sendMessage(charToCheck.getDeity().getColor() + charToCheck.getName() + ChatColor.YELLOW + " belongs to " + charToCheck.getOfflinePlayer().getName() + ".");
		return true;
	}

	private boolean alliance(CommandSender sender, String[] args)
	{
		// Check permissions
		if(!sender.hasPermission("demigods.basic")) return Messages.noPermission(sender);<commit_msg>Oopsie.<commit_after>package com.censoredsoftware.demigods.engine.command;

import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

import org.apache.commons.lang.StringUtils;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import com.censoredsoftware.censoredlib.helper.WrappedCommand;
import com.censoredsoftware.censoredlib.language.Symbol;
import com.censoredsoftware.censoredlib.util.Maps2;
import com.censoredsoftware.censoredlib.util.Strings;
import com.censoredsoftware.censoredlib.util.Titles;
import com.censoredsoftware.demigods.engine.Demigods;
import com.censoredsoftware.demigods.engine.battle.Battle;
import com.censoredsoftware.demigods.engine.data.TributeManager;
import com.censoredsoftware.demigods.engine.deity.Alliance;
import com.censoredsoftware.demigods.engine.language.Translation;
import com.censoredsoftware.demigods.engine.player.DCharacter;
import com.censoredsoftware.demigods.engine.player.DPlayer;
import com.censoredsoftware.demigods.engine.util.Messages;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;

public class GeneralCommands extends WrappedCommand
{
	public GeneralCommands()
	{
		super(Demigods.PLUGIN, false);
	}

	@Override
	public Set<String> getCommands()
	{
		return Sets.newHashSet("check", "owner", "binds", "leaderboard", "alliance", "values", "names");
	}

	@Override
	public boolean processCommand(CommandSender sender, Command command, String[] args)
	{
		if(command.getName().equalsIgnoreCase("check")) return check(sender);
		else if(command.getName().equalsIgnoreCase("owner")) return owner(sender, args);
		else if(command.getName().equalsIgnoreCase("alliance")) return alliance(sender, args);
		else if(command.getName().equalsIgnoreCase("binds")) return binds(sender);
		else if(command.getName().equalsIgnoreCase("leaderboard")) return leaderboard(sender);
		else if(command.getName().equalsIgnoreCase("tributes")) return tributes(sender);
		else if(command.getName().equalsIgnoreCase("names")) return names(sender);
		return false;
	}

	private boolean check(CommandSender sender)
	{
		Player player = (Player) sender;
		DCharacter character = DPlayer.Util.getPlayer(player).getCurrent();

		if(character == null)
		{
			player.sendMessage(ChatColor.RED + "You are nothing but a mortal. You have no worthy statistics.");
			return true;
		}

		// Define variables
		int kills = character.getKillCount();
		int deaths = character.getDeathCount();
		String charName = character.getName();
		String deity = character.getDeity().getName();
		Alliance alliance = character.getAlliance();

		int favor = character.getMeta().getFavor();
		int maxFavor = character.getMeta().getMaxFavor();
		int ascensions = character.getMeta().getAscensions();
		int skillPoints = character.getMeta().getSkillPoints();
		ChatColor deityColor = character.getDeity().getColor();
		ChatColor favorColor = Strings.getColor(character.getMeta().getFavor(), character.getMeta().getMaxFavor());

		// Set player status
		String status = ChatColor.YELLOW + "Ready.";
		if(!character.canPvp()) status = ChatColor.DARK_AQUA + "Safe.";
		else if(Battle.Util.isInBattle(character)) status = ChatColor.GOLD + "In battle.";

		// Send the user their info via chat
		Messages.tagged(sender, "Player Check");

		sender.sendMessage(ChatColor.GRAY + " " + Symbol.RIGHTWARD_ARROW + " " + ChatColor.RESET + "Character: " + deityColor + charName);
		sender.sendMessage(ChatColor.GRAY + " " + Symbol.RIGHTWARD_ARROW + " " + ChatColor.RESET + "Deity: " + deityColor + deity + ChatColor.WHITE + " of the " + ChatColor.GOLD + alliance.getName() + "s");
		sender.sendMessage(ChatColor.GRAY + " " + Symbol.RIGHTWARD_ARROW + " " + ChatColor.RESET + "Favor: " + favorColor + favor + ChatColor.GRAY + " (of " + ChatColor.GREEN + maxFavor + ChatColor.GRAY + ")");
		sender.sendMessage(ChatColor.GRAY + " " + Symbol.RIGHTWARD_ARROW + " " + ChatColor.RESET + "Ascensions: " + ChatColor.GREEN + ascensions);
		sender.sendMessage(ChatColor.GRAY + " " + Symbol.RIGHTWARD_ARROW + " " + ChatColor.RESET + "Available Skill Points: " + ChatColor.GREEN + skillPoints);
		sender.sendMessage(ChatColor.GRAY + " " + Symbol.RIGHTWARD_ARROW + " " + ChatColor.RESET + "Kills: " + ChatColor.GREEN + kills + ChatColor.WHITE + " / Deaths: " + ChatColor.RED + deaths + ChatColor.GRAY + " (Ratio: " + (deaths == 0 ? kills : (Math.round(kills / deaths * 100.0) / 100.0)) + ")");
		sender.sendMessage(ChatColor.GRAY + " " + Symbol.RIGHTWARD_ARROW + " " + ChatColor.RESET + "Status: " + status);

		return true;
	}

	private boolean owner(CommandSender sender, String[] args)
	{
		// Check permissions
		if(!sender.hasPermission("demigods.basic")) return Messages.noPermission(sender);

		Player player = (Player) sender;
		if(args.length < 1)
		{
			player.sendMessage(ChatColor.RED + "You must select a character.");
			player.sendMessage(ChatColor.RED + "/owner <character>");
			return true;
		}
		DCharacter charToCheck = DCharacter.Util.getCharacterByName(args[0]);
		if(charToCheck == null) player.sendMessage(ChatColor.RED + "That character doesn't exist.");
		else player.sendMessage(charToCheck.getDeity().getColor() + charToCheck.getName() + ChatColor.YELLOW + " belongs to " + charToCheck.getOfflinePlayer().getName() + ".");
		return true;
	}

	private boolean alliance(CommandSender sender, String[] args)
	{
		// Check permissions
		if(!sender.hasPermission("demigods.basic")) return Messages.noPermission(sender);
{'fraction_non_alphanumeric': 0.1390699313017439, 'fraction_numerical': 0.002113792496036639, 'mean_word_length': 5.259647188533627, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '7665343', 'n_tokens_mistral': 3799, 'n_tokens_neox': 3494, 'n_words': 667}