Package net.minecraft.item

Examples of net.minecraft.item.ItemArmor


        if (slot != null && slot.getHasStack()) {
            ItemStack stack = slot.getStack();
            transferredStack = stack.copy();

            if (stack.getItem() instanceof ItemArmor) {
                ItemArmor armor = (ItemArmor) stack.getItem();
                if (!getSlot(90 + armor.armorType).getHasStack()) {
                    getSlot(90 + armor.armorType).putStack(transferredStack);
                    slot.putStack(null);
                    return transferredStack;
                }
View Full Code Here


                    ISpecialArmor armor = (ISpecialArmor)stack.getItem();
                    prop = armor.getProperties(entity, stack, source, damage / 25D, x).copy();
                }
                else if (stack.getItem() instanceof ItemArmor && !source.isUnblockable())
                {
                    ItemArmor armor = (ItemArmor)stack.getItem();
                    prop = new ArmorProperties(0, armor.damageReduceAmount / 25D, armor.getMaxDamage() + 1 - stack.getItemDamage());
                }
                if (prop != null)
                {
                    prop.Slot = x;
                    dmgVals.add(prop);
View Full Code Here

    if (stack == null) return -1;
   
    Item item = stack.getItem();
    if (!(item instanceof ItemArmor)) return -1;
   
    ItemArmor itemarmor = (ItemArmor)item;
    TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
    textureManager.bindTexture(RenderBiped.getArmorResource(entity, stack, slot, null));
   
    ModelBiped modelBiped = ForgeHooksClient.getArmorModel(entity, stack, slot, null);
    setRenderPassModel(modelBiped);
    if (modelBiped != null) {
      modelBiped.onGround = mainModel.onGround;
      modelBiped.isRiding = mainModel.isRiding;
      modelBiped.isChild = mainModel.isChild;
    }
   
    int color = itemarmor.getColor(stack);
    if (color != -1) {
      RenderUtils.setColorFromInt(color);
      if (stack.isItemEnchanted()) return 31;
      return 16;
    }
View Full Code Here

                  shouldEquip = false;
                }
              } else if (item instanceof ItemArmor && !(oldItem.getItem() instanceof ItemArmor)) {
                shouldEquip = true;
              } else if (item instanceof ItemArmor && oldItem.getItem() instanceof ItemArmor) {
                ItemArmor newArmor = (ItemArmor) item;
                ItemArmor oldArmor = (ItemArmor) oldItem.getItem();

                if (newArmor.damageReduceAmount == oldArmor.damageReduceAmount) {
                  shouldEquip = itemStack.getItemDamage() > oldItem.getItemDamage() || itemStack.hasTagCompound() && !oldItem.hasTagCompound();
                } else {
                  shouldEquip = newArmor.damageReduceAmount > oldArmor.damageReduceAmount;
View Full Code Here

TOP

Related Classes of net.minecraft.item.ItemArmor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.