Java Code Examples for net.minecraft.entity.player.EntityPlayer.getCurrentArmor()

The following are Jave code examples for showing how to use getCurrentArmor() of the net.minecraft.entity.player.EntityPlayer class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: DecompiledMinecraft   File: ItemArmor.java   View Source Code Vote up 5 votes
/**
 * 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)
{
    int i = EntityLiving.getArmorPosition(itemStackIn) - 1;
    ItemStack itemstack = playerIn.getCurrentArmor(i);

    if (itemstack == null)
    {
        playerIn.setCurrentItemOrArmor(i, itemStackIn.copy());
        itemStackIn.stackSize = 0;
    }

    return itemStackIn;
}
 
Example 2
Project: DecompiledMinecraft   File: ItemArmor.java   View Source Code Vote up 5 votes
/**
 * 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)
{
    int i = EntityLiving.getArmorPosition(itemStackIn) - 1;
    ItemStack itemstack = playerIn.getCurrentArmor(i);

    if (itemstack == null)
    {
        playerIn.setCurrentItemOrArmor(i, itemStackIn.copy());
        itemStackIn.stackSize = 0;
    }

    return itemStackIn;
}
 
Example 3
Project: BaseClient   File: ItemArmor.java   View Source Code Vote up 5 votes
/**
 * 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)
{
    int i = EntityLiving.getArmorPosition(itemStackIn) - 1;
    ItemStack itemstack = playerIn.getCurrentArmor(i);

    if (itemstack == null)
    {
        playerIn.setCurrentItemOrArmor(i, itemStackIn.copy());
        itemStackIn.stackSize = 0;
    }

    return itemStackIn;
}
 
Example 4
Project: BaseClient   File: ItemArmor.java   View Source Code Vote up 5 votes
/**
 * 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)
{
    int i = EntityLiving.getArmorPosition(itemStackIn) - 1;
    ItemStack itemstack = playerIn.getCurrentArmor(i);

    if (itemstack == null)
    {
        playerIn.setCurrentItemOrArmor(i, itemStackIn.copy());
        itemStackIn.stackSize = 0;
    }

    return itemStackIn;
}