<commit_before>package com.arkcraft.mod.common.items;

import com.arkcraft.mod.GlobalAdditions;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;

/**
 * @author Vastatio
 */
public class ARKFood extends ItemFood {
	
	private PotionEffect[] effects;
	private boolean alwaysEdible;
	
	public ARKFood(String name, int healAmount, float sat, boolean fav, boolean alwaysEdible, PotionEffect... effects) {
		super(healAmount, sat, fav);
		this.setUnlocalizedName(name);
		this.setCreativeTab(GlobalAdditions.tabARK);
		GameRegistry.registerItem(this, name);
		this.effects = effects;
		this.alwaysEdible = alwaysEdible;
		
	}

	@Override
	protected void onFoodEaten(ItemStack stack, World worldIn,
			EntityPlayer player) {
		super.onFoodEaten(stack, worldIn, player);
		for (int i = 0; i < effects.length; i ++) {
	        if (!worldIn.isRemote && effects[i] != null && effects[i].getPotionID() > 0)
	            player.addPotionEffect(new PotionEffect(this.effects[i].getPotionID(), this.effects[i].getDuration(), this.effects[i].getAmplifier(), this.effects[i].getIsAmbient(), this.effects[i].getIsShowParticles()));
	    }
	}
	@Override
	public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn)
    {
        if (playerIn.canEat(this.alwaysEdible))
        {
            playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn));
        }

        return itemStackIn;
    }
		
	@Override
	  public ItemFood setAlwaysEdible()
    {
        this.alwaysEdible = true;
        return this;
    }
	
	public static ItemStack getSeedForBerry(ItemStack stack) {
		if (stack != null) {
			if (stack.getItem() instanceof ARKSeedItem) {
				if (stack.getItem() == (Item) ARKCraftItems.amarBerrySeed)
					return new ItemStack(ARKCraftItems.amarBerry);
				if (stack.getItem() == (Item) ARKCraftItems.azulBerrySeed)
					return new ItemStack(ARKCraftItems.azulBerry);
				if (stack.getItem() == (Item) ARKCraftItems.mejoBerrySeed)
					return new ItemStack(ARKCraftItems.mejoBerry);
				if (stack.getItem() == (Item) ARKCraftItems.narcoBerrySeed)
					return new ItemStack(ARKCraftItems.narcoBerry);
				if (stack.getItem() == (Item) ARKCraftItems.tintoBerrySeed)
					return new ItemStack(ARKCraftItems.tintoBerry);
			}
		}
		return null;
	}

	// Seconds that this food will tame a Dino
	public static int getItemFeedTime(ItemStack stack) {
		if (stack != null) {
			if (stack.getItem() instanceof ARKFood) {
				if (stack.getItem() == (Item) ARKCraftItems.porkchop_cooked)
					return 25;
				if (stack.getItem() == (Item) ARKCraftItems.porkchop_raw)
					return 10;
				if (stack.getItem() == (Item) ARKCraftItems.primemeat_cooked)
					return 50;
				if (stack.getItem() == (Item) ARKCraftItems.primemeat_raw)
					return 25;
			}
		}
		return 0;
	}
	
	// Seconds that this food will keep a dino unconscious
	public static int getItemTorporTime(ItemStack stack) {
		if (stack != null) {
			if (stack.getItem() instanceof ARKFood) {
				if (stack.getItem() == (Item) ARKCraftItems.narcoBerry)
					return 25;
			}
		}
		return 0;
	}
}<commit_msg>Addons for recipies<commit_after>package com.arkcraft.mod.common.items;

import com.arkcraft.mod.GlobalAdditions;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;

/**
 * @author Vastatio
 */
public class ARKFood extends ItemFood {
	
	private PotionEffect[] effects;
	private boolean alwaysEdible;
	public static int globalHealAmount; //Used For Adding XP On Register
	
	public ARKFood(String name, int healAmount, float sat, boolean fav, boolean alwaysEdible, PotionEffect... effects) {
		super(healAmount, sat, fav);
		this.setUnlocalizedName(name);
		this.setCreativeTab(GlobalAdditions.tabARK);
		GameRegistry.registerItem(this, name);
		this.effects = effects;
		this.alwaysEdible = alwaysEdible;
		this.globalHealAmount = healAmount;
		
	}

	@Override
	protected void onFoodEaten(ItemStack stack, World worldIn,
			EntityPlayer player) {
		super.onFoodEaten(stack, worldIn, player);
		for (int i = 0; i < effects.length; i ++) {
	        if (!worldIn.isRemote && effects[i] != null && effects[i].getPotionID() > 0)
	            player.addPotionEffect(new PotionEffect(this.effects[i].getPotionID(), this.effects[i].getDuration(), this.effects[i].getAmplifier(), this.effects[i].getIsAmbient(), this.effects[i].getIsShowParticles()));
	    }
	}
	@Override
	public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn)
    {
        if (playerIn.canEat(this.alwaysEdible))
        {
            playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn));
        }

        return itemStackIn;
    }
		
	@Override
	  public ItemFood setAlwaysEdible()
    {
        this.alwaysEdible = true;
        return this;
    }
	
	public static ItemStack getSeedForBerry(ItemStack stack) {
		if (stack != null) {
			if (stack.getItem() instanceof ARKSeedItem) {
				if (stack.getItem() == (Item) ARKCraftItems.amarBerrySeed)
					return new ItemStack(ARKCraftItems.amarBerry);
				if (stack.getItem() == (Item) ARKCraftItems.azulBerrySeed)
					return new ItemStack(ARKCraftItems.azulBerry);
				if (stack.getItem() == (Item) ARKCraftItems.mejoBerrySeed)
					return new ItemStack(ARKCraftItems.mejoBerry);
				if (stack.getItem() == (Item) ARKCraftItems.narcoBerrySeed)
					return new ItemStack(ARKCraftItems.narcoBerry);
				if (stack.getItem() == (Item) ARKCraftItems.tintoBerrySeed)
					return new ItemStack(ARKCraftItems.tintoBerry);
			}
		}
		return null;
	}

	// Seconds that this food will tame a Dino
	public static int getItemFeedTime(ItemStack stack) {
		if (stack != null) {
			if (stack.getItem() instanceof ARKFood) {
				if (stack.getItem() == (Item) ARKCraftItems.porkchop_cooked)
					return 25;
				if (stack.getItem() == (Item) ARKCraftItems.porkchop_raw)
					return 10;
				if (stack.getItem() == (Item) ARKCraftItems.primemeat_cooked)
					return 50;
				if (stack.getItem() == (Item) ARKCraftItems.primemeat_raw)
					return 25;
			}
		}
		return 0;
	}
	
	// Seconds that this food will keep a dino unconscious
	public static int getItemTorporTime(ItemStack stack) {
		if (stack != null) {
			if (stack.getItem() instanceof ARKFood) {
				if (stack.getItem() == (Item) ARKCraftItems.narcoBerry)
					return 25;
			}
		}
		return 0;
	}
	
	public static int getXPFromSmelting() {
		return globalHealAmount / 2;
	}
}
{'fraction_non_alphanumeric': 0.1157603149147106, 'fraction_numerical': 0.00422802157748943, 'mean_word_length': 3.931703810208483, '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': '6984152', 'n_tokens_mistral': 2586, 'n_tokens_neox': 2266, 'n_words': 487}