package net.minecraft.item; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityFishHook; import net.minecraft.stats.StatList; import net.minecraft.world.World; public class ItemFishingRod extends Item { private static final String __OBFID = "CL_00000034"; public ItemFishingRod() { this.setMaxDamage(64); this.setMaxStackSize(1); this.setCreativeTab(CreativeTabs.tabTools); } /** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */ public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) { if (playerIn.fishEntity != null) { int var4 = playerIn.fishEntity.handleHookRetraction(); itemStackIn.damageItem(var4, playerIn); playerIn.swingItem(); } else { worldIn.playSoundAtEntity(playerIn, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!worldIn.isRemote) { worldIn.spawnEntityInWorld(new EntityFishHook(worldIn, playerIn)); } playerIn.swingItem(); playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); } return itemStackIn; } /** * Checks isDamagable and if it cannot be stacked */ public boolean isItemTool(ItemStack stack) { return super.isItemTool(stack); } /** * Return the enchantability factor of the item, most of the time is based on material. */ public int getItemEnchantability() { return 1; } }