Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. package me.stupplayer.mod.blocks;
  2.  
  3. import me.stupplayer.mod.itens.ItemMultiTool;
  4. import net.minecraft.block.Block;
  5. import net.minecraft.block.material.Material;
  6. import net.minecraft.creativetab.CreativeTabs;
  7. import net.minecraft.entity.player.EntityPlayer;
  8. import net.minecraft.world.World;
  9.  
  10. public class BlocoRegen extends Block
  11. {
  12. protected BlocoRegen(Material material) {
  13. super(material);
  14. this.setHardness(30);
  15. this.setCreativeTab(CreativeTabs.tabBlock);
  16. this.setBlockName("BlocoRegen");
  17. this.setBlockTextureName("BlocoRegen");
  18. }
  19.  
  20. @Override
  21. public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int face, float f1, float f2, float f3)
  22. {
  23. int damage = entityPlayer.getCurrentEquippedItem().getItemDamage();
  24. int exp1 = -15;
  25. int exp2 = -10;
  26.  
  27. if(entityPlayer.getCurrentEquippedItem() != null)
  28. {
  29. if(entityPlayer.getCurrentEquippedItem().getItem() instanceof ItemMultiTool)
  30. {
  31. if(entityPlayer.experienceLevel > 15 && damage > 0)
  32. {
  33. entityPlayer.getCurrentEquippedItem().setItemDamage(damage - 2000);
  34. entityPlayer.addExperienceLevel(exp1);
  35. }
  36. else if(damage == 3000)
  37. {
  38.  
  39. }
  40. }
  41. }
  42. return super.onBlockActivated(world, x, y, z, entityPlayer, face, f1, f2, f3);
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement