(World worldIn, Random rand, BlockPos pos, IBlockState state)
| 105 | } |
| 106 | |
| 107 | public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) |
| 108 | { |
| 109 | BlockPos blockpos = pos.up(); |
| 110 | |
| 111 | for (int i = 0; i < 128; ++i) |
| 112 | { |
| 113 | BlockPos blockpos1 = blockpos; |
| 114 | int j = 0; |
| 115 | |
| 116 | while (true) |
| 117 | { |
| 118 | if (j >= i / 16) |
| 119 | { |
| 120 | if (worldIn.getBlockState(blockpos1).getBlock().blockMaterial == Material.air) |
| 121 | { |
| 122 | if (rand.nextInt(8) == 0) |
| 123 | { |
| 124 | BlockFlower.EnumFlowerType blockflower$enumflowertype = worldIn.getBiomeGenForCoords(blockpos1).pickRandomFlower(rand, blockpos1); |
| 125 | BlockFlower blockflower = blockflower$enumflowertype.getBlockType().getBlock(); |
| 126 | IBlockState iblockstate = blockflower.getDefaultState().withProperty(blockflower.getTypeProperty(), blockflower$enumflowertype); |
| 127 | |
| 128 | if (blockflower.canBlockStay(worldIn, blockpos1, iblockstate)) |
| 129 | { |
| 130 | worldIn.setBlockState(blockpos1, iblockstate, 3); |
| 131 | } |
| 132 | } |
| 133 | else |
| 134 | { |
| 135 | IBlockState iblockstate1 = Blocks.tallgrass.getDefaultState().withProperty(BlockTallGrass.TYPE, BlockTallGrass.EnumType.GRASS); |
| 136 | |
| 137 | if (Blocks.tallgrass.canBlockStay(worldIn, blockpos1, iblockstate1)) |
| 138 | { |
| 139 | worldIn.setBlockState(blockpos1, iblockstate1, 3); |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | break; |
| 145 | } |
| 146 | |
| 147 | blockpos1 = blockpos1.add(rand.nextInt(3) - 1, (rand.nextInt(3) - 1) * rand.nextInt(3) / 2, rand.nextInt(3) - 1); |
| 148 | |
| 149 | if (worldIn.getBlockState(blockpos1.down()).getBlock() != Blocks.grass || worldIn.getBlockState(blockpos1).getBlock().isNormalCube()) |
| 150 | { |
| 151 | break; |
| 152 | } |
| 153 | |
| 154 | ++j; |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | public EnumWorldBlockLayer getBlockLayer() |
| 160 | { |
nothing calls this directly
no test coverage detected