Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.github.venom1987.TutMod1.items;
- import com.github.venom1987.TutMod1.help.Reference;
- import com.github.venom1987.TutMod1.tabs.ModTabs;
- import net.minecraft.enchantment.Enchantment;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.PlayerCapabilities;
- 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 ItemTutorialumArmor extends ItemArmor
- {
- public ItemTutorialumArmor(ArmorMaterial material, int ArmorType, String name)
- {
- super(material, 0, ArmorType);
- setUnlocalizedName(name);
- setTextureName(Reference.MODID + ":" + getUnlocalizedName().substring(5));
- setCreativeTab(ModTabs.tabTutorialMod);
- }
- public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
- {
- if (stack.getItem() == Armory.tutorialumHelm || stack.getItem() == Armory.tutorialumPlate || stack.getItem() == Armory.tutorialumBoots)
- {
- return Reference.MODID + ":models/armor/tutorialum_layer1.png";
- }
- else if (stack.getItem() == Armory.tutorialumPants)
- {
- return Reference.MODID + ":models/armor/tutorialum_layer2.png";
- }
- else
- {
- return null;
- }
- }
- public PlayerCapabilities capabilities = new PlayerCapabilities();
- @Override
- public void onArmorTick(World world, EntityPlayer player, ItemStack stack)
- {
- if (player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem().equals(Armory.tutorialumBoots)
- && player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem().equals(Armory.tutorialumPants)
- && player.getCurrentArmor(2) != null && player.getCurrentArmor(2).getItem().equals(Armory.tutorialumPlate)
- && player.getCurrentArmor(3) != null && player.getCurrentArmor(3).getItem().equals(Armory.tutorialumHelm))
- {
- player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 20*1, 2));
- player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 20*1, 1));
- player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 20*1));
- player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 20*1));
- player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 20*1, 1));
- player.fallDistance=0F;
- player.capabilities.allowFlying=true;
- }
- else
- player.capabilities.allowFlying=false;
- player.capabilities.isFlying=false;
- }
- public void onCreated(ItemStack stack, World world, EntityPlayer player)
- {
- stack.addEnchantment(Enchantment.unbreaking, 3);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment