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

Method updateTick

src/main/java/net/minecraft/block/BlockPortal.java:35–59  ·  view source on GitHub ↗
(World worldIn, BlockPos pos, IBlockState state, Random rand)

Source from the content-addressed store, hash-verified

33 }
34
35 public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
36 {
37 super.updateTick(worldIn, pos, state, rand);
38
39 if (worldIn.provider.isSurfaceWorld() && worldIn.getGameRules().getGameRuleBooleanValue("doMobSpawning") && rand.nextInt(2000) < worldIn.getDifficulty().getDifficultyId())
40 {
41 int i = pos.getY();
42 BlockPos blockpos;
43
44 for (blockpos = pos; !World.doesBlockHaveSolidTopSurface(worldIn, blockpos) && blockpos.getY() > 0; blockpos = blockpos.down())
45 {
46 ;
47 }
48
49 if (i > 0 && !worldIn.getBlockState(blockpos.up()).getBlock().isNormalCube())
50 {
51 Entity entity = ItemMonsterPlacer.spawnCreature(worldIn, 57, (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 1.1D, (double)blockpos.getZ() + 0.5D);
52
53 if (entity != null)
54 {
55 entity.timeUntilPortal = entity.getPortalCooldown();
56 }
57 }
58 }
59 }
60
61 public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state)
62 {

Callers

nothing calls this directly

Calls 15

downMethod · 0.95
upMethod · 0.95
spawnCreatureMethod · 0.95
getPortalCooldownMethod · 0.95
nextIntMethod · 0.80
getDifficultyIdMethod · 0.80
isNormalCubeMethod · 0.80
getYMethod · 0.65
getBlockMethod · 0.65
getBlockStateMethod · 0.65
getXMethod · 0.65

Tested by

no test coverage detected