Advertisement
lol123406

Untitled

Apr 28th, 2015
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.88 KB | None | 0 0
  1. package net.Ethereal.armor;
  2.  
  3. import net.Ethereal.EtherealMain;
  4. import net.minecraft.entity.Entity;
  5. import net.minecraft.entity.player.EntityPlayer;
  6. import net.minecraft.item.Item;
  7. import net.minecraft.item.ItemArmor;
  8. import net.minecraft.item.ItemStack;
  9. import net.minecraft.potion.Potion;
  10. import net.minecraft.potion.PotionEffect;
  11. import net.minecraft.world.World;
  12.  
  13. public class EtherealArmor extends ItemArmor {
  14.  
  15.     public EtherealArmor(ArmorMaterial material,int id, int armorPlacement) {
  16.         super(material, id, armorPlacement);
  17.         setCreativeTab(EtherealMain.EtherealTabCombat);
  18.        
  19.         if(armorPlacement == 0){
  20.             this.setTextureName(EtherealMain.modid + ":" + "EtherealHelm");
  21.         }else if(armorPlacement == 1){
  22.             this.setTextureName(EtherealMain.modid + ":" + "EtherealChestplate");
  23.            
  24.         }else if(armorPlacement == 2){
  25.             this.setTextureName(EtherealMain.modid + ":" + "EtherealPants");
  26.            
  27.         }else if(armorPlacement == 3){
  28.             this.setTextureName(EtherealMain.modid + ":" + "EtherealBoots");
  29.            
  30.         }
  31.        
  32.     }
  33.         public String getArmorTexture(ItemStack stack, Entity entity,  int slot, String type) {
  34.             if (stack.getItem() == EtherealMain.itemEtherealHelm || stack.getItem() == EtherealMain.itemEtherealChestplate || stack.getItem() == EtherealMain.itemEtherealBoots) {
  35.                 return EtherealMain.modid + ":textures/armor/Ethereal_1.png";
  36.                
  37.             }else if (stack.getItem() == EtherealMain.itemEtherealPants) {
  38.                 return EtherealMain.modid + ":textures/armor/Ethereal_2.png";
  39.         }else{
  40.             return null;
  41.         }
  42.         }
  43.  
  44.            
  45.             public void onArmorTick(World world, EntityPlayer player, ItemStack itemstack){
  46.                
  47.                
  48.                
  49.            
  50.             if (player.getCurrentArmor(3) != null){
  51.                 ItemStack helmet = player.getCurrentArmor(3);
  52.                 if (helmet.getItem() == EtherealMain.itemEtherealHelm)
  53.                     player.addPotionEffect(new PotionEffect (Potion.nightVision.getId(), 1000));
  54.            
  55.                
  56.                
  57.         if (player.getCurrentArmor(3) != null && player.getCurrentArmor(2) != null && player.getCurrentArmor(1) != null && player.getCurrentArmor(0) != null){
  58.             ItemStack helmet1 = player.getCurrentArmor(3);
  59.             ItemStack chestplate = player.getCurrentArmor(2);
  60.             ItemStack pants = player.getCurrentArmor(1);
  61.             ItemStack boots = player.getCurrentArmor(0);
  62.            
  63.             if (helmet1.getItem() == EtherealMain.itemEtherealHelm && chestplate.getItem() == EtherealMain.itemEtherealChestplate && pants.getItem() == EtherealMain.itemEtherealPants && boots.getItem() == EtherealMain.itemEtherealBoots){
  64.                 player.addPotionEffect(new PotionEffect (Potion.fireResistance.getId(), 1000));
  65.                 player.addPotionEffect(new PotionEffect (Potion.resistance.getId(), 1000));
  66.                 player.addPotionEffect(new PotionEffect (Potion.damageBoost.getId(), 1000));
  67.                 player.addPotionEffect(new PotionEffect (Potion.waterBreathing.getId(), 1000));
  68.                 player.addPotionEffect(new PotionEffect (Potion.regeneration.getId(), 1000));
  69.             }
  70.         }
  71.    
  72.            
  73.     }
  74.        
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement