Java Code Examples for net.minecraft.item.Item.isValidArmor()

The following are Jave code examples for showing how to use isValidArmor() of the net.minecraft.item.Item class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: pnc-repressurized   File:   Source Code and License Vote up 5 votes
 * Check if the stack is a valid item for this slot. Always true beside for
 * the armor slots.
public boolean isItemValid(ItemStack par1ItemStack) {
    Item item = par1ItemStack.getItem();
    EntityEquipmentSlot eq = EntityEquipmentSlot.values()[armorType + 2];  // 0 & 1 are main & off hands
    return item.isValidArmor(par1ItemStack, eq, player);