<commit_before>package com.lothrazar.samscontent.command;

import java.util.ArrayList;
import java.util.List;
import com.lothrazar.util.Util;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.BlockPos;

public class CommandHearts implements ICommand
{
	private static boolean REQUIRES_OP = true; // always
	private ArrayList<String> aliases = new ArrayList<String>();

	@Override
	public int compareTo(Object arg0)
	{
		return 0;
	}

	@Override
	public String getName()
	{
		return "sethearts";
	}

	@Override
	public String getCommandUsage(ICommandSender sender)
	{
		return "/"+getName()+" <player> <hearts>";
	}

	@Override
	public List getAliases()
	{
		return aliases;
	}

	@Override
	public void execute(ICommandSender sender, String[] args)		throws CommandException
	{ 
		EntityPlayer ptarget  = null;
		
		int hearts = 0;
		try
		{
			ptarget = MinecraftServer.getServer().getConfigurationManager().getPlayerByUsername(args[0]);
			
			if(ptarget == null)
			{
				Util.addChatMessage(getCommandUsage(sender));
				return;
			}
		}
		catch (Exception e)
		{
			Util.addChatMessage(getCommandUsage(sender));
			return;
		}
		try
		{
			hearts = Integer.parseInt(args[1]);
		}
		catch (Exception e)
		{
			Util.addChatMessage(getCommandUsage(sender));
			return;
		}
		

		Util.setMaxHealth(ptarget, hearts*2);
	}

	@Override
	public boolean canCommandSenderUse(ICommandSender sender)
	{ 
		return (REQUIRES_OP) ? sender.canUseCommand(2, this.getName()) : true; 
	}

	@Override
	public List addTabCompletionOptions(ICommandSender sender, String[] args,	BlockPos pos)
	{
		return null;
	}

	@Override
	public boolean isUsernameIndex(String[] args, int index)
	{
		return false;
	}

}
<commit_msg>sethealth : do not allow zero<commit_after>package com.lothrazar.samscontent.command;

import java.util.ArrayList;
import java.util.List;
import com.lothrazar.util.Util;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.BlockPos;

public class CommandHearts implements ICommand
{
	private static boolean REQUIRES_OP = true; // always
	private ArrayList<String> aliases = new ArrayList<String>();

	@Override
	public int compareTo(Object arg0)
	{
		return 0;
	}

	@Override
	public String getName()
	{
		return "sethearts";
	}

	@Override
	public String getCommandUsage(ICommandSender sender)
	{
		return "/"+getName()+" <player> <hearts>";
	}

	@Override
	public List getAliases()
	{
		return aliases;
	}

	@Override
	public void execute(ICommandSender sender, String[] args)		throws CommandException
	{ 
		EntityPlayer ptarget  = null;
		
		int hearts = 0;
		try
		{
			ptarget = MinecraftServer.getServer().getConfigurationManager().getPlayerByUsername(args[0]);
			
			if(ptarget == null)
			{
				Util.addChatMessage(getCommandUsage(sender));
				return;
			}
		}
		catch (Exception e)
		{
			Util.addChatMessage(getCommandUsage(sender));
			return;
		}
		try
		{
			hearts = Integer.parseInt(args[1]);
		}
		catch (Exception e)
		{
			Util.addChatMessage(getCommandUsage(sender));
			return;
		}
		
		if(hearts < 1) {hearts = 1;}
		
		Util.setMaxHealth(ptarget, hearts*2);
	}

	@Override
	public boolean canCommandSenderUse(ICommandSender sender)
	{ 
		return (REQUIRES_OP) ? sender.canUseCommand(2, this.getName()) : true; 
	}

	@Override
	public List addTabCompletionOptions(ICommandSender sender, String[] args,	BlockPos pos)
	{
		return null;
	}

	@Override
	public boolean isUsernameIndex(String[] args, int index)
	{
		return false;
	}

}

{'fraction_non_alphanumeric': 0.11004412146379444, 'fraction_numerical': 0.004152608357124318, 'mean_word_length': 4.367688022284122, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 11, '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': '4740607', 'n_tokens_mistral': 1393, 'n_tokens_neox': 1280, 'n_words': 270}