Melontank

Untitled

Aug 23rd, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.52 KB | None | 0 0
  1. package Melontank.Meloncraft.item;
  2.  
  3. import Melontank.Meloncraft.common.Meloncraft;
  4. import net.minecraft.block.Block;
  5. import net.minecraft.client.renderer.texture.IconRegister;
  6. import net.minecraft.entity.item.EntityItem;
  7. import net.minecraft.entity.player.EntityPlayer;
  8. import net.minecraft.item.Item;
  9. import net.minecraft.item.ItemStack;
  10. import net.minecraft.world.World;
  11.  
  12. public class ItemStoneHammer extends Item {
  13.  
  14.     public ItemStoneHammer(int par1) {
  15.         super(par1);
  16.         this.setCreativeTab(Meloncraft.TabMeloncraft);
  17.    
  18.        
  19.        
  20.        
  21.     public boolean onItemUse (ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
  22.     {
  23.        
  24.          if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack))   
  25.          {
  26.              return false;
  27.          }
  28.          else
  29.          {
  30.              
  31.          }
  32.        
  33.        
  34.             int i1 = par3World.getBlockId(par4, par5, par6);
  35.            
  36.             int i2 = par3World.getBlockMetadata(par4, par5, par6);
  37.            
  38.            
  39.             if (i1 != Block.cobblestone.blockID)
  40.             {
  41.                 return false;
  42.             }
  43.             else
  44.             {
  45.                 EntityItem entityitem = new EntityItem(par3World, par4, par5, par6, new ItemStack(Item.diamond, 10));
  46.                 entityitem.delayBeforeCanPickup = 10;
  47.                 par3World.spawnEntityInWorld(entityitem);
  48.             }
  49.  
  50.        
  51.        
  52.        
  53.     }
  54.  
  55.    
  56.    
  57.    
  58.     public void registerIcons(IconRegister iconRegister) {
  59.         itemIcon = iconRegister.registerIcon("Meloncraft:StoneHammer");
  60.     }  
  61.    
  62.    
  63.    
  64.    
  65.    
  66.    
  67.    
  68.    
  69. }
Advertisement
Add Comment
Please, Sign In to add comment