ItemFishingRod .java

net.minecraft.item.ItemFishingRod (class): members: shouldRotateAroundWhenRendering, isItemTool, isFull3D, getItemEnchantability, onItemRightClick.

net.minecraft.itemclass78 linescommonextends Item2.0 KB

API Surface (5)

boolean isFull3D()
boolean shouldRotateAroundWhenRendering()
ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn)
boolean isItemTool(ItemStack stack)
int getItemEnchantability()

String literals (1)

"random.bow"

Code Graph: Dependencies (7)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ItemFishingRod.java78 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.item;
2
3
import net.minecraft.creativetab.CreativeTabs;
4
import net.minecraft.entity.player.EntityPlayer;
5
import net.minecraft.entity.projectile.EntityFishHook;
6
import net.minecraft.stats.StatList;
7
import net.minecraft.world.World;
8
9
public class ItemFishingRod extends Item
10
{
11
    public ItemFishingRod()
12
    {
13
        this.setMaxDamage(64);
14
        this.setMaxStackSize(1);
15
        this.setCreativeTab(CreativeTabs.tabTools);
16
    }
17
18
    /**
19
     * Returns True is the item is renderer in full 3D when hold.
20
     */
21
    public boolean isFull3D()
22
    {
23
        return true;
24
    }
25
26
    /**
27
     * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities
28
     * hands.
29
     */
30
    public boolean shouldRotateAroundWhenRendering()
31
    {
32
        return true;
33
    }
34
35
    /**
36
     * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
37
     */
38
    public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn)
39
    {
40
        if (playerIn.fishEntity != null)
41
        {
42
            int i = playerIn.fishEntity.handleHookRetraction();
43
            itemStackIn.damageItem(i, playerIn);
44
            playerIn.swingItem();
45
        }
46
        else
47
        {
48
            worldIn.playSoundAtEntity(playerIn, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
49
50
            if (!worldIn.isRemote)
51
            {
52
                worldIn.spawnEntityInWorld(new EntityFishHook(worldIn, playerIn));
53
            }
54
55
            playerIn.swingItem();
56
            playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);
57
        }
58
59
        return itemStackIn;
60
    }
61
62
    /**
63
     * Checks isDamagable and if it cannot be stacked
64
     */
65
    public boolean isItemTool(ItemStack stack)
66
    {
67
        return super.isItemTool(stack);
68
    }
69
70
    /**
71
     * Return the enchantability factor of the item, most of the time is based on material.
72
     */
73
    public int getItemEnchantability()
74
    {
75
        return 1;
76
    }
77
}
78

Deobfuscated MCP 1.8.9 source of ItemFishingRod from Marcelektro/MavenMCP-1.8.9 (net/minecraft/item/ItemFishingRod.java), stored verbatim.