(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te)
| 31 | } |
| 32 | |
| 33 | public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) |
| 34 | { |
| 35 | player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); |
| 36 | player.addExhaustion(0.025F); |
| 37 | |
| 38 | if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(player)) |
| 39 | { |
| 40 | ItemStack itemstack = this.createStackedBlock(state); |
| 41 | |
| 42 | if (itemstack != null) |
| 43 | { |
| 44 | spawnAsEntity(worldIn, pos, itemstack); |
| 45 | } |
| 46 | } |
| 47 | else |
| 48 | { |
| 49 | if (worldIn.provider.doesWaterVaporize()) |
| 50 | { |
| 51 | worldIn.setBlockToAir(pos); |
| 52 | return; |
| 53 | } |
| 54 | |
| 55 | int i = EnchantmentHelper.getFortuneModifier(player); |
| 56 | this.dropBlockAsItem(worldIn, pos, state, i); |
| 57 | Material material = worldIn.getBlockState(pos.down()).getBlock().getMaterial(); |
| 58 | |
| 59 | if (material.blocksMovement() || material.isLiquid()) |
| 60 | { |
| 61 | worldIn.setBlockState(pos, Blocks.flowing_water.getDefaultState()); |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * Returns the quantity of items to drop on block destruction. |
nothing calls this directly
no test coverage detected