MrDood_Modding

ItemOrderArmor.java

Feb 3rd, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.44 KB | None | 0 0
  1. package com.josh.gomc.armor;
  2.  
  3. import com.josh.gomc.Main;
  4.  
  5. import net.minecraft.entity.Entity;
  6. import net.minecraft.entity.player.EntityPlayer;
  7. import net.minecraft.item.ItemStack;
  8. import net.minecraft.item.ItemArmor;
  9. import net.minecraft.item.ItemArmor.ArmorMaterial;
  10. import net.minecraft.potion.Potion;
  11. import net.minecraft.potion.PotionEffect;
  12. import net.minecraft.world.World;
  13.  
  14. public class ItemOrderArmor extends ItemArmor{
  15.     private String textureName;
  16.  
  17.     public ItemOrderArmor(ArmorMaterial material, int type, String textureName) {
  18.         super(material, 0, type);
  19.         this.textureName = textureName;
  20.     }
  21.     @Override
  22.     public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
  23.     {
  24.         return "gomc:textures/models/armor/" + this.textureName + "_" + (this.armorType == 2 ? "2" : "1") + ".png";
  25.     }
  26.     @Override
  27.     public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
  28.         if (itemStack.getItem().equals(Main.itemOrderHelmet))
  29.             player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 300));
  30.         if (itemStack.getItem().equals(Main.itemOrderLeggings))
  31.             player.addPotionEffect(new PotionEffect(Potion.jump.id, 40, 3));
  32.         if (itemStack.getItem().equals(Main.itemOrderChestplate))
  33.             player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 40, 4));
  34.         if (itemStack.getItem().equals(Main.itemOrderBoots))
  35.             player.addPotionEffect(new PotionEffect(Potion.resistance.id, 40, 3));
  36.     }
  37. }
Add Comment
Please, Sign In to add comment