Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.dragoniamod.dragonia.common.armors;
- import fr.dragoniamod.dragonia.common.DragoniaMod;
- 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 ItemImprovedTitaniumArmor extends ItemArmor {
- public ItemImprovedTitaniumArmor(ArmorMaterial material, int type)
- {
- super(material, 0, type);
- }
- public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
- {
- if(stack.getItem() == DragoniaMod.leggingsImprovedTitanium)
- {
- return DragoniaMod.MODID + ":textures/models/armor/improvedtitanium_layer_2.png";
- }
- return DragoniaMod.MODID + ":textures/models/armor/improvedtitanium_layer_1.png";
- }
- public boolean getIsRepairable(ItemStack input, ItemStack repair)
- {
- if(repair.getItem() == DragoniaMod.bootsImprovedTitanium || repair.getItem() == DragoniaMod.itemImprovedTitaniumIngot)
- {
- return true;
- }
- if(repair.getItem() == DragoniaMod.helmetImprovedTitanium|| repair.getItem() == DragoniaMod.itemImprovedTitaniumIngot)
- {
- return true;
- }
- if(repair.getItem() == DragoniaMod.leggingsImprovedTitanium || repair.getItem() == DragoniaMod.itemImprovedTitaniumIngot)
- {
- return true;
- }
- if(repair.getItem() == DragoniaMod.chestPlateImprovedTitanium || repair.getItem() == DragoniaMod.itemImprovedTitaniumIngot)
- {
- return true;
- }
- // etc...
- return false;
- }
- public void onArmorTick(World world, EntityPlayer player, ItemStack stack)
- {
- if(this.armorType == 0 && this.getArmorMaterial() == DragoniaMod.armorImprovedTitanium)
- {
- player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 240, 0));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement