コード例 #1
0
 /**
  * Returns whether the current item (tool) can harvest from the specified block (actually get a
  * result).
  */
 public boolean canHarvestBlock(Block par1Block) {
   if (par1Block.blockMaterial.isToolNotRequired()) {
     return true;
   } else {
     ItemStack var2 = this.getStackInSlot(this.currentItem);
     return var2 != null ? var2.canHarvestBlock(par1Block) : false;
   }
 }
コード例 #2
0
 public boolean canHarvestBlock(Block block) {
   if (block.blockMaterial.func_31055_i()) {
     return true;
   }
   ItemStack itemstack = getStackInSlot(currentItem);
   if (itemstack != null) {
     return itemstack.canHarvestBlock(block);
   } else {
     return false;
   }
 }