Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.src;
- public class ItemEmptyMirage<itemID> extends Item
- {
- public static int itemID;
- {
- itemID = 500;
- }
- public ItemEmptyMirage(int i, EnumToolMod enumtoolmod)
- {
- super(i);
- maxStackSize = 1;
- setMaxDamage(enumtoolmod.getMaxUses());
- weaponDamage = 4 + enumtoolmod.getDamageVsEntity() * 2;
- }
- public float getStrVsBlock(ItemStack itemstack, Block block)
- {
- return block.blockID != Block.web.blockID ? 1.5F : 15F;
- }
- public boolean hitEntity(ItemStack itemEmptyMirage, EntityLiving entityliving, EntityLiving entityliving1)
- {
- itemEmptyMirage.damageItem(1, entityliving1);
- this.checkForSwap(itemEmptyMirage);
- return true;
- }
- public boolean onBlockDestroyed(ItemStack itemEmptyMirage, int i, int j, int k, int l, EntityLiving entityliving)
- {
- itemEmptyMirage.damageItem(2, entityliving);
- this.checkForSwap(itemEmptyMirage);
- return true;
- }
- public int getDamageVsEntity(Entity entity)
- {
- return weaponDamage;
- }
- public boolean isFull3D()
- {
- return true;
- }
- public void checkForSwap(ItemStack itemEmptyMirage)
- {
- int i = itemEmptyMirage.getItemDamage();
- if (i > 40)
- {
- itemEmptyMirage.itemID = ItemEmptyMirageAIDA.itemID;
- System.out.println("It changed.");
- }
- else
- {
- itemEmptyMirage.itemID = ItemEmptyMirage.itemID;
- System.out.println("It stayed the same.");
- }
- }
- public EnumAction getItemUseAction(ItemStack itemstack)
- {
- return EnumAction.block;
- }
- public int getMaxItemUseDuration(ItemStack itemstack)
- {
- return 0x11940;
- }
- public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
- {
- entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack));
- return itemstack;
- }
- public boolean canHarvestBlock(Block block)
- {
- return block.blockID == Block.web.blockID;
- }
- private int weaponDamage;
- }
Advertisement
Add Comment
Please, Sign In to add comment