(World worldIn, BlockPos pos, IBlockState state, Random rand)
| 54 | } |
| 55 | |
| 56 | public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) |
| 57 | { |
| 58 | if (!worldIn.isRemote) |
| 59 | { |
| 60 | if (worldIn.getLightFromNeighbors(pos.up()) < 4 && worldIn.getBlockState(pos.up()).getBlock().getLightOpacity() > 2) |
| 61 | { |
| 62 | worldIn.setBlockState(pos, Blocks.dirt.getDefaultState()); |
| 63 | } |
| 64 | else |
| 65 | { |
| 66 | if (worldIn.getLightFromNeighbors(pos.up()) >= 9) |
| 67 | { |
| 68 | for (int i = 0; i < 4; ++i) |
| 69 | { |
| 70 | BlockPos blockpos = pos.add(rand.nextInt(3) - 1, rand.nextInt(5) - 3, rand.nextInt(3) - 1); |
| 71 | Block block = worldIn.getBlockState(blockpos.up()).getBlock(); |
| 72 | IBlockState iblockstate = worldIn.getBlockState(blockpos); |
| 73 | |
| 74 | if (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos.up()) >= 4 && block.getLightOpacity() <= 2) |
| 75 | { |
| 76 | worldIn.setBlockState(blockpos, Blocks.grass.getDefaultState()); |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Get the Item that this Block should drop when harvested. |
nothing calls this directly
no test coverage detected