(World worldIn, BlockPos pos, int chance, Random random, int age)
| 285 | } |
| 286 | |
| 287 | private void catchOnFire(World worldIn, BlockPos pos, int chance, Random random, int age) |
| 288 | { |
| 289 | int i = this.getFlammability(worldIn.getBlockState(pos).getBlock()); |
| 290 | |
| 291 | if (random.nextInt(chance) < i) |
| 292 | { |
| 293 | IBlockState iblockstate = worldIn.getBlockState(pos); |
| 294 | |
| 295 | if (random.nextInt(age + 10) < 5 && !worldIn.canLightningStrike(pos)) |
| 296 | { |
| 297 | int j = age + random.nextInt(5) / 4; |
| 298 | |
| 299 | if (j > 15) |
| 300 | { |
| 301 | j = 15; |
| 302 | } |
| 303 | |
| 304 | worldIn.setBlockState(pos, this.getDefaultState().withProperty(AGE, j), 3); |
| 305 | } |
| 306 | else |
| 307 | { |
| 308 | worldIn.setBlockToAir(pos); |
| 309 | } |
| 310 | |
| 311 | if (iblockstate.getBlock() == Blocks.tnt) |
| 312 | { |
| 313 | Blocks.tnt.onBlockDestroyedByPlayer(worldIn, pos, iblockstate.withProperty(BlockTNT.EXPLODE, Boolean.TRUE)); |
| 314 | } |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | private boolean canNeighborCatchFire(World worldIn, BlockPos pos) |
| 319 | { |
no test coverage detected