Guest User

Untitled

a guest
Oct 6th, 2011
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. package net.minecraft.src;
  2.  
  3. public class ItemEmptyMirage<itemID> extends Item
  4. {
  5.  
  6. public static int itemID;
  7. {
  8. itemID = 500;
  9. }
  10. public ItemEmptyMirage(int i, EnumToolMod enumtoolmod)
  11. {
  12. super(i);
  13. maxStackSize = 1;
  14. setMaxDamage(enumtoolmod.getMaxUses());
  15. weaponDamage = 4 + enumtoolmod.getDamageVsEntity() * 2;
  16. }
  17.  
  18. public float getStrVsBlock(ItemStack itemstack, Block block)
  19. {
  20. return block.blockID != Block.web.blockID ? 1.5F : 15F;
  21. }
  22.  
  23. public boolean hitEntity(ItemStack itemEmptyMirage, EntityLiving entityliving, EntityLiving entityliving1)
  24. {
  25. itemEmptyMirage.damageItem(1, entityliving1);
  26. this.checkForSwap(itemEmptyMirage);
  27. return true;
  28. }
  29.  
  30. public boolean onBlockDestroyed(ItemStack itemEmptyMirage, int i, int j, int k, int l, EntityLiving entityliving)
  31. {
  32. itemEmptyMirage.damageItem(2, entityliving);
  33. this.checkForSwap(itemEmptyMirage);
  34. return true;
  35. }
  36.  
  37. public int getDamageVsEntity(Entity entity)
  38. {
  39. return weaponDamage;
  40. }
  41.  
  42. public boolean isFull3D()
  43. {
  44. return true;
  45. }
  46.  
  47. public void checkForSwap(ItemStack itemEmptyMirage)
  48. {
  49. int i = itemEmptyMirage.getItemDamage();
  50. if (i > 40)
  51. {
  52. itemEmptyMirage.itemID = ItemEmptyMirageAIDA.itemID;
  53. System.out.println("It changed.");
  54. }
  55. else
  56. {
  57. itemEmptyMirage.itemID = ItemEmptyMirage.itemID;
  58. System.out.println("It stayed the same.");
  59. }
  60.  
  61. }
  62.  
  63. public EnumAction getItemUseAction(ItemStack itemstack)
  64. {
  65. return EnumAction.block;
  66. }
  67.  
  68. public int getMaxItemUseDuration(ItemStack itemstack)
  69. {
  70. return 0x11940;
  71. }
  72.  
  73. public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
  74. {
  75. entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack));
  76. return itemstack;
  77. }
  78.  
  79. public boolean canHarvestBlock(Block block)
  80. {
  81. return block.blockID == Block.web.blockID;
  82. }
  83.  
  84. private int weaponDamage;
  85. }
  86.  
  87.  
Advertisement
Add Comment
Please, Sign In to add comment