Advertisement
Guest User

Untitled

a guest
Aug 9th, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. package fr.iprox.titan.items;
  2.  
  3. import fr.iprox.titan.reference;
  4. import fr.iprox.titan.init.ItemMod;
  5. import net.minecraft.entity.Entity;
  6. import net.minecraft.entity.player.EntityPlayer;
  7. import net.minecraft.item.ItemArmor;
  8. import net.minecraft.item.ItemStack;
  9. import net.minecraft.potion.Potion;
  10. import net.minecraft.potion.PotionEffect;
  11. import net.minecraft.util.MathHelper;
  12. import net.minecraft.world.World;
  13.  
  14. public class ItemArmorTitane extends ItemArmor {
  15.  
  16. public ItemArmorTitane(ArmorMaterial material, int metaData)
  17. {
  18. super(material, 0, metaData);
  19.  
  20. }
  21.  
  22. public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
  23. {
  24.  
  25. if(stack.getItem() == ItemMod.pantalonArmor)
  26. {
  27. return reference.MOD_ID + ":textures/modèls/armor/armorMod_layer_2.png";
  28. }
  29.  
  30. else if(stack.getItem() == ItemMod.casqueArmor || stack.getItem() == ItemMod.plastronArmor || stack.getItem() == ItemMod.bottesArmor)
  31. {
  32. return reference.MOD_ID + ":textures/modèls/armor/armorMod_layer_1.png";
  33. }
  34. return null;
  35.  
  36.  
  37.  
  38. }
  39.  
  40.  
  41. public void onArmorTick(World world, EntityPlayer player, ItemStack Stack)
  42. {
  43.  
  44.  
  45. if(Stack.getItem() == ItemMod.casqueArmor && world.getLightBrightness(MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ)) < 7)
  46. {
  47. player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 210, 1));
  48. }
  49.  
  50. if(Stack.getItem() == ItemMod.bottesArmor)
  51. {
  52. player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 210, 1));
  53. }
  54.  
  55.  
  56.  
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement