<commit_before>package net.genesishub.gFeatures.Feature.gWarsSuite;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;

/*
gFeatures
https://github.com/GenesisHub/gFeatures

   Copyright 2015 GenesisHub

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

public class CommandHub {
	public void onCommand(final CommandSender sender, Command cmd, String label, String[] args){
		if(cmd.getName().equalsIgnoreCase("gWars")){
			if(args.length == 0){
				sender.sendMessage(ChatColor.GRAY + "Do /gWars help");
			}
			else if(args.length == 1){
				
			}
		}
	}
}<commit_msg>gFeatures 2.5.3 - Better error handling<commit_after>package net.genesishub.gFeatures.Feature.gWarsSuite;

import net.genesishub.gFeatures.Basic;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

/*
gFeatures
https://github.com/GenesisHub/gFeatures

   Copyright 2015 GenesisHub

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

public class CommandHub {
	Statistics stats = new Statistics();
	public void onCommand(final CommandSender sender, Command cmd, String label, String[] args){
		if(cmd.getName().equalsIgnoreCase("gWars")){
			if(args.length == 0){
				sender.sendMessage(ChatColor.GRAY + "Do /gWars help.");
			}
			else if(args.length == 1){
				if(args[0].equalsIgnoreCase("help")){
					sender.sendMessage(ChatColor.GRAY + "[x] [x] Help [x] [x]");
					sender.sendMessage(ChatColor.AQUA + "/gWars stats [Player] - Shows your stats or another player.");
					sender.sendMessage(ChatColor.AQUA + "/gWars kills [add/set/minus] [amount] [Player] - Sets a player's kills stat.");
					sender.sendMessage(ChatColor.AQUA + "/gWars deaths [add/set/minus] [amount] [Player] - Sets a player's deaths stat.");
					sender.sendMessage(ChatColor.AQUA + "/gWars mode [value] [Player] - Sets a player's mode stat.");
					sender.sendMessage(ChatColor.AQUA + "/gWars version - Shows the version. ");
				}
				else if(args[0].equalsIgnoreCase("stats")){
					sender.sendMessage(ChatColor.GRAY + "[x] [x] Stats [x] [x]");
					sender.sendMessage(ChatColor.AQUA + "Kills: " + stats.getKills((Player)sender));
					sender.sendMessage(ChatColor.AQUA + "Deaths: " + stats.getDeaths((Player)sender));
					sender.sendMessage(ChatColor.AQUA + "Mode: " + stats.getMode((Player)sender));
				}
				else if(args[0].equalsIgnoreCase("version")){
					sender.sendMessage(ChatColor.GRAY + "gWarsSuite version " + Basic.getFeature("gWarsSuite").getVersion());
				}
				else{
					sender.sendMessage(ChatColor.AQUA + "Do /gWars help.");
				}
			}
			else if(args.length == 2){
				if(args[0].equalsIgnoreCase("stats")){
					for(Player p : Bukkit.getOnlinePlayers()){
						if(p.getName().equalsIgnoreCase(args[1])){
							sender.sendMessage(ChatColor.GRAY + "[x] [x] Stats [x] [x]");
							sender.sendMessage(ChatColor.AQUA + "Kills: " + stats.getKills(p));
							sender.sendMessage(ChatColor.AQUA + "Deaths: " + stats.getDeaths(p));
							sender.sendMessage(ChatColor.AQUA + "Mode: " + stats.getMode(p));
						}
					}
					try{
						for(OfflinePlayer p : Bukkit.getOfflinePlayers()){
							if(p.getName().equalsIgnoreCase(args[1])){
								sender.sendMessage(ChatColor.GRAY + "[x] [x] Stats [x] [x]");
								sender.sendMessage(ChatColor.AQUA + "Kills: " + stats.getKills((Player)p));
								sender.sendMessage(ChatColor.AQUA + "Deaths: " + stats.getDeaths((Player)p));
								sender.sendMessage(ChatColor.AQUA + "Mode: " + stats.getMode((Player)p));
							}
						}
					}
					catch(Exception e){
						sender.sendMessage(ChatColor.RED + "An error occured with your input.");
					}
				}
				else{
					sender.sendMessage(ChatColor.AQUA + "Do /gWars help.");
				}
			}
			else if(args.length == 3){
				if(args[0].equalsIgnoreCase("mode")){
					for(Player p : Bukkit.getOnlinePlayers()){
						if(p.getName().equalsIgnoreCase(args[2])){
							for(gWarsMode modes : gWarsMode.values()){
								if(modes.toString().equals(args[1])){
								sender.sendMessage(ChatColor.AQUA + "Set " + args[1] + "'s mode to " + args);
								}
							}
						}
					}
					try{
						for(OfflinePlayer p : Bukkit.getOfflinePlayers()){
							if(p.getName().equalsIgnoreCase(args[2])){
								sender.sendMessage(ChatColor.AQUA + "Kills: " + stats.getKills((Player)p));
							}
						}
					}
					catch(Exception e){
						sender.sendMessage(ChatColor.RED + "An error occured with your input.");
					}
				}
				else{
					sender.sendMessage(ChatColor.AQUA + "Do /gWars help.");
				}
			}
			else{
				sender.sendMessage(ChatColor.AQUA + "Do /gWars help.");
			}
		}
	}
}
{'fraction_non_alphanumeric': 0.13706731605496608, 'fraction_numerical': 0.006261958601495913, 'mean_word_length': 3.433307632999229, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '1693016', 'n_tokens_mistral': 2256, 'n_tokens_neox': 1839, 'n_words': 432}