Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.josh.gomc.armor;
- import com.josh.gomc.Main;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.player.EntityPlayer;
- 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 ItemGodArmor extends ItemArmor{
- private String textureName;
- public ItemGodArmor(ArmorMaterial material, int type, String textureName) {
- super(material, 0, type);
- this.textureName = textureName;
- }
- @Override
- public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
- {
- return "gomc:textures/models/armor/" + this.textureName + "_" + (this.armorType == 2 ? "2" : "1") + ".png";
- }
- @Override
- public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
- if (itemStack.getItem().equals(Main.itemGodHelmet))
- player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 300));
- player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300));
- if (itemStack.getItem().equals(Main.itemGodLeggings))
- player.addPotionEffect(new PotionEffect(Potion.jump.id, 40, 3));
- if (itemStack.getItem().equals(Main.itemGodChestplate))
- player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 40, 10));
- player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 40, 2));
- if (itemStack.getItem().equals(Main.itemGodBoots))
- player.addPotionEffect(new PotionEffect(Potion.resistance.id, 40, 9));
- player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 40, 2));
- if(player.getCurrentArmor(3) != null && player.getCurrentArmor(2) != null && player.getCurrentArmor(1) != null && player.getCurrentArmor(0) != null){
- ItemStack helmet = player.getCurrentArmor(3);
- ItemStack chestplate = player.getCurrentArmor(2);
- ItemStack leggings = player.getCurrentArmor(1);
- ItemStack boots = player.getCurrentArmor(0);
- if(helmet.getItem() == Main.itemGodHelmet && chestplate.getItem() == Main.itemGodChestplate && leggings.getItem() == Main.itemGodLeggings && boots.getItem() == Main.itemGodBoots) {
- player.capabilities.allowFlying = true;
- player.fallDistance = 0.0f;
- }else {
- player.capabilities.allowFlying = false;
- player.capabilities.isFlying = false;
- }
- }else{
- player.capabilities.allowFlying = false;
- player.capabilities.isFlying = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment