MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / catchOnFire

Method catchOnFire

src/main/java/net/minecraft/block/BlockFire.java:287–316  ·  view source on GitHub ↗
(World worldIn, BlockPos pos, int chance, Random random, int age)

Source from the content-addressed store, hash-verified

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 {

Callers 1

updateTickMethod · 0.95

Calls 10

getFlammabilityMethod · 0.95
getBlockMethod · 0.95
withPropertyMethod · 0.95
nextIntMethod · 0.80
canLightningStrikeMethod · 0.80
getDefaultStateMethod · 0.80
setBlockToAirMethod · 0.80
getBlockStateMethod · 0.65
setBlockStateMethod · 0.45

Tested by

no test coverage detected