Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.iprox.titan.items;
- import fr.iprox.titan.reference;
- import fr.iprox.titan.init.ItemMod;
- 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.util.MathHelper;
- import net.minecraft.world.World;
- public class ItemArmorTitane extends ItemArmor {
- public ItemArmorTitane(ArmorMaterial material, int metaData)
- {
- super(material, 0, metaData);
- }
- public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
- {
- if(stack.getItem() == ItemMod.pantalonArmor)
- {
- return reference.MOD_ID + ":textures/modèls/armor/armorMod_layer_2.png";
- }
- else if(stack.getItem() == ItemMod.casqueArmor || stack.getItem() == ItemMod.plastronArmor || stack.getItem() == ItemMod.bottesArmor)
- {
- return reference.MOD_ID + ":textures/modèls/armor/armorMod_layer_1.png";
- }
- return null;
- }
- public void onArmorTick(World world, EntityPlayer player, ItemStack Stack)
- {
- if(Stack.getItem() == ItemMod.casqueArmor && world.getLightBrightness(MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ)) < 7)
- {
- player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 210, 1));
- }
- if(Stack.getItem() == ItemMod.bottesArmor)
- {
- player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 210, 1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement