Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package vayper.morePowerCraft.armors;
- import java.util.List;
- import vayper.morePowerCraft.MorePowerCraft;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.item.ItemArmor;
- import net.minecraft.item.ItemStack;
- import net.minecraft.item.ItemArmor.ArmorMaterial;
- import net.minecraft.potion.Potion;
- import net.minecraft.potion.PotionEffect;
- import net.minecraft.world.World;
- public class DivineArmor extends ItemArmor
- {
- //Constructeur
- public DivineArmor(ArmorMaterial material, int type)
- {
- super(material, 0, type);
- this.setCreativeTab(MorePowerCraft.combatTab);
- }
- //Textures sur le personnage
- public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
- {
- if(slot == 2)
- {
- return MorePowerCraft.MODID + ":textures/armors/divine_2.png";
- }
- return MorePowerCraft.MODID + ":textures/armors/divine_1.png";
- }
- //Infos supp. sur l'armure || 0 = heaume || 1 = plastron || 2 = jambières || 3 = Bottes
- public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par2List, boolean par4)
- {
- par2List.add("\u00A71\u00A76\u00A7l" + "Devenez un Dieu !");
- par2List.add("\u00A71\u00A7b" + "Fatal si le set est complet");
- }
- // Particule enchantées
- @Override
- public boolean hasEffect(ItemStack par1ItemStack)
- {
- return true;
- }
- // Réparable : Oui
- public boolean getIsRepairable(ItemStack input, ItemStack repair)
- {
- if(repair.getItem() == MorePowerCraft.divineGem)
- {
- return true;
- }
- return false;
- }
- // Effets de l'armures (potions etc...)
- public void onArmorTick(World world, EntityPlayer player, ItemStack stack)
- {
- ItemStack boots = player.getEquipmentInSlot(1);
- ItemStack leggings = player.getEquipmentInSlot(2);
- ItemStack chestPlate = player.getEquipmentInSlot(3);
- ItemStack helmet = player.getEquipmentInSlot(4);
- if(helmet != null && helmet.getItem() == MorePowerCraft.divineHelmet)
- {
- player.addPotionEffect(new PotionEffect(Potion.nightVision.getId(), 50, 0));
- player.addPotionEffect(new PotionEffect(Potion.waterBreathing.getId(), 2, 0));
- }
- if(boots != null && boots.getItem() == MorePowerCraft.divineBoots)
- {
- if(player.isSprinting())
- {
- player.addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 2, 3));
- }
- player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 2, 0));
- }
- if(boots != null &&boots.getItem() == MorePowerCraft.divineBoots && helmet != null && helmet.getItem() == MorePowerCraft.divineHelmet && chestPlate != null &&
- chestPlate.getItem() == MorePowerCraft.divineBody && leggings != null && leggings.getItem() == MorePowerCraft.divineLegs )
- {
- player.setInvisible(true);
- player.addPotionEffect(new PotionEffect(Potion.jump.getId(), 2, 4));
- player.addPotionEffect(new PotionEffect(Potion.digSpeed.getId(), 2, 1));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement