Пример #1
0
 @Override
 public ArrayList<ItemStack> doHarvest() {
   int meta = blockPos.getBlockMeta(world);
   ArrayList<ItemStack> harvest;
   if (block == Blocks.brown_mushroom_block) {
     harvest =
         Blocks.brown_mushroom_block.getDrops(world, blockPos.x, blockPos.y, blockPos.z, meta, 0);
   } else {
     harvest =
         Blocks.red_mushroom_block.getDrops(world, blockPos.x, blockPos.y, blockPos.z, meta, 0);
   }
   blockPos.setBlock(world, Blocks.air);
   Proxies.common.addBlockDestroyEffects(world, blockPos.x, blockPos.y, blockPos.z, block, 0);
   return harvest;
 }
Пример #2
0
 @Override
 public void growCrop(ItemStack crop, BlockPosition blockPos) {
   if (crop.isItemEqual(new ItemStack(Blocks.sapling))) {
     ((BlockSapling) Blocks.sapling)
         .func_149853_b(worldObj, worldObj.rand, blockPos.x, blockPos.y, blockPos.z);
   }
   if (ForestryProxy.moduleArboricultureEnabled) {
     if (crop.isItemEqual(new ItemStack(ForestryProxy.blockSapling))) {
       ForestryProxy.blockSapling.func_149853_b(
           worldObj, worldObj.rand, blockPos.x, blockPos.y, blockPos.z);
     }
   }
   if (crop.getItem() == Item.getItemFromBlock(Blocks.wheat)) {
     ((BlockCrops) Blocks.wheat)
         .func_149853_b(worldObj, worldObj.rand, blockPos.x, blockPos.y, blockPos.z);
   }
   if (crop.isItemEqual(new ItemStack(Blocks.nether_wart))) {
     blockPos.setBlock(worldObj, blockPos.getBlock(worldObj), 3);
   }
 }