Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.src;
- import java.util.Random;
- import javax.swing.plaf.basic.BasicMenuUI.ChangeHandler;
- public class ItemJoint extends Item {
- private int healAmount;
- public ItemJoint(int i) {
- super(i);
- healAmount = 6;
- maxStackSize = 1;
- }
- //private final float saturationModifier;
- private boolean alwaysSmokeable;
- // private int potionId;
- // private int potionDuration;
- // private int potionAmplifier;
- // private float potionEffectProbability;
- public int getHealAmount() {
- return healAmount;
- }
- public boolean alwaysSmokeable() {
- return true;
- }
- public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) {
- boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
- if (flag || par3EntityPlayer.inventory.hasItem(mod_WeedItems.Lighter.shiftedIndex)) {
- int i = getMaxItemUseDuration(par1ItemStack) - par4;
- float f = (float) i / 20F;
- f = (f * f + f * 2.0F) / 3F;
- if ((double) f < 0.1D) {
- return;
- }
- if (f > 1.0F) {
- f = 1.0F;
- }
- par1ItemStack.damageItem(1, par3EntityPlayer);
- par2World.playSoundAtEntity(par3EntityPlayer, "fire.fire", 1.0F, 0.5F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
- double var11 = (double) ((float) par3EntityPlayer.posX + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F);
- double var13 = (double) ((float) par3EntityPlayer.posY + 0.8125F);
- double var15 = (double) ((float) par3EntityPlayer.posZ + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F);
- world.spawnParticle("smoke", var11, var13, var15, 0, 0, 0);
- if (!flag) {
- par3EntityPlayer.inventory.consumeInventoryItem(mod_WeedItems.Lighter.shiftedIndex);
- } else {
- }
- if (!par2World.isRemote) {
- }
- }
- }
- public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
- return par1ItemStack;
- }
- public int getMaxItemUseDuration(ItemStack par1ItemStack) {
- return 0x11940;
- }
- public EnumAction getItemUseAction(ItemStack par1ItemStack) {
- return EnumAction.bow;
- }
- public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) {
- if (entityplayer.capabilities.isCreativeMode || entityplayer.inventory.hasItem(mod_WeedItems.Lighter.shiftedIndex)) {
- entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack));
- world.playSoundAtEntity(entityplayer, "fire.fire", 1F, 1F / (itemRand.nextFloat() * 0.4F + 0.8F));
- }
- return itemstack;
- // if(entityplayer.inventory.consumeInventoryItem(mod_WeedItems.Joint.shiftedIndex))
- // if(entityplayer.inventory.consumeInventoryItem(mod_WeedItems.HazeJoint.shiftedIndex)){
- // {
- //entityplayer.addChatMessage("This will actually do something later. An animation or something (:");
- // public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
- // {
- // super.randomDisplayTick(par1World, par2, par3, par4, par5Random);
- // if (par5Random.nextInt(75) == 0)
- // {
- // par1World.spawnParticle("weedsmoke", (float)par2 + par5Random.nextFloat(), (float)par3 + 1.1F, (float)par4 + par5Random.nextFloat(), 20.0D, 20.0D, 20.0D);
- // }
- //}
- //entityplayer.setPotionEffect(Potion.hunger.id, 30, 3, 1.4F);
- //entityplayer.heal(healAmount);
- }
- //roach
- {
- // }
- // entityplayer.addChatMessage("This will actually do something later. An animation or something (:");
- // entityplayer.heal(healAmount);
- // world.playSoundAtEntity(entityplayer, "fire.fire", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 0.8F));
- // return new ItemStack(mod_WeedItems.Roach);
- }
- }
Advertisement