GenuineSounds

Join with smoke

Jul 14th, 2012
196
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.72 KB | None | 0 0
  1. package net.minecraft.src;
  2.  
  3. import java.util.Random;
  4. import javax.swing.plaf.basic.BasicMenuUI.ChangeHandler;
  5.  
  6. public class ItemJoint extends Item {
  7.  
  8.     private int healAmount;
  9.  
  10.     public ItemJoint(int i) {
  11.         super(i);
  12.         healAmount = 6;
  13.         maxStackSize = 1;
  14.     }
  15.  
  16.     //private final float saturationModifier;
  17.     private boolean alwaysSmokeable;
  18.  
  19.     // private int potionId;
  20.     // private int potionDuration;
  21.     // private int potionAmplifier;
  22.     //  private float potionEffectProbability;
  23.     public int getHealAmount() {
  24.         return healAmount;
  25.     }
  26.  
  27.     public boolean alwaysSmokeable() {
  28.         return true;
  29.     }
  30.  
  31.     public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) {
  32.         boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
  33.         if (flag || par3EntityPlayer.inventory.hasItem(mod_WeedItems.Lighter.shiftedIndex)) {
  34.             int i = getMaxItemUseDuration(par1ItemStack) - par4;
  35.             float f = (float) i / 20F;
  36.             f = (f * f + f * 2.0F) / 3F;
  37.             if ((double) f < 0.1D) {
  38.                 return;
  39.             }
  40.             if (f > 1.0F) {
  41.                 f = 1.0F;
  42.             }
  43.             par1ItemStack.damageItem(1, par3EntityPlayer);
  44.             par2World.playSoundAtEntity(par3EntityPlayer, "fire.fire", 1.0F, 0.5F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
  45.             double var11 = (double) ((float) par3EntityPlayer.posX + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F);
  46.             double var13 = (double) ((float) par3EntityPlayer.posY + 0.8125F);
  47.             double var15 = (double) ((float) par3EntityPlayer.posZ + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F);
  48.             world.spawnParticle("smoke", var11, var13, var15, 0, 0, 0);
  49.             if (!flag) {
  50.                 par3EntityPlayer.inventory.consumeInventoryItem(mod_WeedItems.Lighter.shiftedIndex);
  51.             } else {
  52.                
  53.             }
  54.             if (!par2World.isRemote) {
  55.                
  56.             }
  57.         }
  58.     }
  59.  
  60.     public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
  61.         return par1ItemStack;
  62.     }
  63.  
  64.     public int getMaxItemUseDuration(ItemStack par1ItemStack) {
  65.         return 0x11940;
  66.     }
  67.  
  68.     public EnumAction getItemUseAction(ItemStack par1ItemStack) {
  69.         return EnumAction.bow;
  70.     }
  71.  
  72.     public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) {
  73.         if (entityplayer.capabilities.isCreativeMode || entityplayer.inventory.hasItem(mod_WeedItems.Lighter.shiftedIndex)) {
  74.             entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack));
  75.             world.playSoundAtEntity(entityplayer, "fire.fire", 1F, 1F / (itemRand.nextFloat() * 0.4F + 0.8F));
  76.         }
  77.         return itemstack;
  78.         //  if(entityplayer.inventory.consumeInventoryItem(mod_WeedItems.Joint.shiftedIndex))
  79.         //      if(entityplayer.inventory.consumeInventoryItem(mod_WeedItems.HazeJoint.shiftedIndex)){
  80.         //    {
  81.         //entityplayer.addChatMessage("This will actually do something later. An animation or something (:");
  82.         //  public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
  83.         //  {
  84.         //    super.randomDisplayTick(par1World, par2, par3, par4, par5Random);
  85.         //      if (par5Random.nextInt(75) == 0)
  86.         //     {
  87.         //       par1World.spawnParticle("weedsmoke", (float)par2 + par5Random.nextFloat(), (float)par3 + 1.1F, (float)par4 + par5Random.nextFloat(), 20.0D, 20.0D, 20.0D);
  88.         // }
  89.         //}
  90.         //entityplayer.setPotionEffect(Potion.hunger.id, 30, 3, 1.4F);
  91.         //entityplayer.heal(healAmount);
  92.     }
  93.  
  94.     //roach
  95.     {
  96.         // }
  97.         //    entityplayer.addChatMessage("This will actually do something later. An animation or something (:");
  98.         //  entityplayer.heal(healAmount);
  99.         //  world.playSoundAtEntity(entityplayer, "fire.fire", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 0.8F));
  100.         //   return new ItemStack(mod_WeedItems.Roach);
  101.     }
  102. }
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment