Advertisement
Naitenne

Armour

Jan 17th, 2015
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.57 KB | None | 0 0
  1. package net.row.item;
  2.  
  3. import net.minecraft.client.model.ModelBiped;
  4. import net.minecraft.entity.Entity;
  5. import net.minecraft.entity.EntityLivingBase;
  6. import net.minecraft.entity.player.EntityPlayer;
  7. import net.minecraft.item.EnumAction;
  8. import net.minecraft.item.ItemArmor;
  9. import net.minecraft.item.ItemStack;
  10. import net.row.registry.RoWItems;
  11. import cpw.mods.fml.relauncher.Side;
  12. import cpw.mods.fml.relauncher.SideOnly;
  13.  
  14. public class ItemEngineersSuit extends ItemArmor{
  15.  
  16.     public ItemEngineersSuit(int par1){
  17.         super(ItemArmor.ArmorMaterial.CLOTH, 0, par1);
  18.         maxStackSize = 1;
  19.     }
  20.  
  21.     @Override
  22.     public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){
  23.         if(stack.getItem() == RoWItems.itemSuitRusEngPants){
  24.             return "row:textures/armour/rus_eng_pants.png";
  25.         }else if(stack.getItem() == RoWItems.itemSuitRusEngShirt){
  26.             return "row:textures/armour/rus_eng_shirt.png";
  27.         }else if(stack.getItem() == RoWItems.itemSuitRusEngCoat){
  28.             return "row:textures/armour/rus_eng_coat.png";
  29.         }else if(stack.getItem() == RoWItems.itemSuitRusEngBoots){
  30.             return "row:textures/armour/rus_eng_boots.png";
  31.         }else
  32.             return "row:textures/armour/rus_eng_cap.png";
  33.     }
  34.  
  35.     @Override
  36.     @SideOnly(Side.CLIENT)
  37.     public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemstack, int armorSlot){
  38.         ModelBiped armourModel = null;
  39.         if(itemstack != null){
  40.             if(itemstack.getItem() instanceof ItemEngineersSuit){
  41.                 float f = 0.125F;
  42.                 if(itemstack.getItem() == RoWItems.itemSuitRusEngPants)
  43.                     f = 0.12F;
  44.                 if(itemstack.getItem() == RoWItems.itemSuitRusEngShirt)
  45.                     f = 0.115F;
  46.                 if(itemstack.getItem() == RoWItems.itemSuitRusEngBoots)
  47.                     f = 0.115F;
  48.                 armourModel = new ModelBiped(f);
  49.                 ItemStack itemstack2 = ((EntityPlayer)entityLiving).inventory.getCurrentItem();
  50.                 armourModel.heldItemRight = itemstack2 != null ? 1 : 0;
  51.                 armourModel.isSneak = entityLiving.isSneaking();
  52.                 if(itemstack2 != null && ((EntityPlayer)entityLiving).getItemInUseCount() > 0){
  53.                     EnumAction enumaction = itemstack2.getItemUseAction();
  54.                     if(enumaction == EnumAction.block){
  55.                         armourModel.heldItemRight = 3;
  56.                     }else if(enumaction == EnumAction.bow){
  57.                         armourModel.aimedBow = true;
  58.                     }
  59.                 }
  60.             }
  61.         }
  62.         return armourModel;
  63.     }
  64.  
  65.     @Override
  66.     public int getColor(ItemStack par1ItemStack){
  67.         return 0xFFFFFF;
  68.     }
  69.  
  70.     @Override
  71.     public int getColorFromItemStack(ItemStack par1ItemStack, int par2){
  72.         return 0xFFFFFF;
  73.     }
  74.  
  75.     @SideOnly(Side.CLIENT)
  76.     public boolean requiresMultipleRenderPasses(){
  77.         return false;
  78.     }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement