Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.Ethereal.armor;
- import net.Ethereal.EtherealMain;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemArmor;
- import net.minecraft.item.ItemStack;
- import net.minecraft.potion.Potion;
- import net.minecraft.potion.PotionEffect;
- import net.minecraft.world.World;
- public class EtherealArmor extends ItemArmor {
- public EtherealArmor(ArmorMaterial material,int id, int armorPlacement) {
- super(material, id, armorPlacement);
- setCreativeTab(EtherealMain.EtherealTabCombat);
- if(armorPlacement == 0){
- this.setTextureName(EtherealMain.modid + ":" + "EtherealHelm");
- }else if(armorPlacement == 1){
- this.setTextureName(EtherealMain.modid + ":" + "EtherealChestplate");
- }else if(armorPlacement == 2){
- this.setTextureName(EtherealMain.modid + ":" + "EtherealPants");
- }else if(armorPlacement == 3){
- this.setTextureName(EtherealMain.modid + ":" + "EtherealBoots");
- }
- }
- public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
- if (stack.getItem() == EtherealMain.itemEtherealHelm || stack.getItem() == EtherealMain.itemEtherealChestplate || stack.getItem() == EtherealMain.itemEtherealBoots) {
- return EtherealMain.modid + ":textures/armor/Ethereal_1.png";
- }else if (stack.getItem() == EtherealMain.itemEtherealPants) {
- return EtherealMain.modid + ":textures/armor/Ethereal_2.png";
- }else{
- return null;
- }
- }
- public void onArmorTick(World world, EntityPlayer player, ItemStack itemstack){
- if (player.getCurrentArmor(3) != null){
- ItemStack helmet = player.getCurrentArmor(3);
- if (helmet.getItem() == EtherealMain.itemEtherealHelm)
- player.addPotionEffect(new PotionEffect (Potion.nightVision.getId(), 1000));
- if (player.getCurrentArmor(3) != null && player.getCurrentArmor(2) != null && player.getCurrentArmor(1) != null && player.getCurrentArmor(0) != null){
- ItemStack helmet1 = player.getCurrentArmor(3);
- ItemStack chestplate = player.getCurrentArmor(2);
- ItemStack pants = player.getCurrentArmor(1);
- ItemStack boots = player.getCurrentArmor(0);
- if (helmet1.getItem() == EtherealMain.itemEtherealHelm && chestplate.getItem() == EtherealMain.itemEtherealChestplate && pants.getItem() == EtherealMain.itemEtherealPants && boots.getItem() == EtherealMain.itemEtherealBoots){
- player.addPotionEffect(new PotionEffect (Potion.fireResistance.getId(), 1000));
- player.addPotionEffect(new PotionEffect (Potion.resistance.getId(), 1000));
- player.addPotionEffect(new PotionEffect (Potion.damageBoost.getId(), 1000));
- player.addPotionEffect(new PotionEffect (Potion.waterBreathing.getId(), 1000));
- player.addPotionEffect(new PotionEffect (Potion.regeneration.getId(), 1000));
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement