Java Code Examples for net.minecraft.init.Items#FISHING_ROD

The following examples show how to use net.minecraft.init.Items#FISHING_ROD . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaitManager.java    From SkyblockAddons with MIT License 5 votes vote down vote up
/**
 * Check if our Player is holding a Fishing Rod, and filters out the Grapple Hook (If any more items are made that
 * are Items.fishing_rods but aren't used for fishing, add them here)
 *
 * @return True if it can be used for fishing
 */
public boolean isHoldingRod() {
    EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;

    if (player != null) {
        ItemStack item = player.getHeldItem();
        if (item == null || item.getItem() != Items.fishing_rod) return false;

        return !"GRAPPLING_HOOK".equals(ItemUtils.getSkyBlockItemID(item));
    }
    return false;
}