@Override public void updateTick(@Nullable World world, @Nullable BlockPos pos, @Nullable IBlockState state, @Nullable Random random) { super.updateTick(world, pos, state, random); boolean shouldGrow = random.nextFloat() < GROWTH_CHANCE_PER_UPDATETICK; if (shouldGrow && !hasTop(state)) deltaGrowth(world, pos, state, 1); }
@Override public void updateTick(@Nonnull World worldIn, @Nonnull BlockPos pos, @Nonnull IBlockState state, Random rand) { if (!worldIn.isRemote) { super.updateTick(worldIn, pos, state, rand); if (worldIn.getLightFromNeighbors(pos.up()) >= 9 && rand.nextInt(7) == 0) { this.grow(worldIn, pos, state, rand); } } }
@Override public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { if (!worldIn.isRemote) { super.updateTick(worldIn, pos, state, rand); if (worldIn.getLightFromNeighbors(pos.up()) >= 9 && rand.nextInt(7) == 0) { grow(worldIn, rand, pos, state); } } }
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) { if (!world.isRemote) { super.updateTick(world, pos, state, rand); if (world.getLightFromNeighbors(pos.up()) >= 9 && rand.nextInt(7) == 0) { grow(world, rand, pos, state); } } }
@Override public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) { if (!world.isRemote) { super.updateTick(world, pos, state, rand); if (world.getLightFromNeighbors(pos.up()) >= 9 && rand.nextInt(7) == 0) { this.grow(world, pos, state, rand); } } }
@Override public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { if (!worldIn.isRemote) { super.updateTick(worldIn, pos, state, rand); if (!worldIn.isAreaLoaded(pos, 1)) return; if (worldIn.getLightFromNeighbors(pos.up()) >= 9 && rand.nextInt(7) == 0) { this.grow(worldIn, rand, pos, state); } } }
@Override public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) { super.updateTick(world, pos, state, rand); if (rand.nextInt(25) == 0) { int xx; int yy; int zz; BlockPos newPos = pos.add(rand.nextInt(3) - 1, rand.nextInt(2) - rand.nextInt(2), rand.nextInt(3) - 1); xx = pos.getX() + rand.nextInt(3) - 1; yy = pos.getY() + rand.nextInt(2) - rand.nextInt(2); zz = pos.getZ() + rand.nextInt(3) - 1; if (world.isAirBlock(newPos) && canBlockStay(world, newPos, state)) { if (state.getValue(PLANT_TYPE) == EnumSmallPlantType.NETTLE && rand.nextInt(3) == 0) world.setBlockState(newPos, this.getDefaultState().withProperty(PLANT_TYPE, EnumSmallPlantType.NETTLE_FLOWERED)); if (state.getValue(PLANT_TYPE) == EnumSmallPlantType.NETTLE_FLOWERED) world.setBlockState(newPos, this.getDefaultState().withProperty(PLANT_TYPE, EnumSmallPlantType.NETTLE)); } } }
@Override public void updateTick(World world, BlockPos pos, IBlockState state, Random random) { super.updateTick(world, pos, state, random); if (!world.isRemote) { TESaplingTFC te = Helpers.getTE(world, pos, TESaplingTFC.class); if (te != null) { long hours = te.getHoursSincePlaced(); if (hours > wood.getMinGrowthTime() * CalenderTFC.HOURS_IN_DAY) { grow(world, random, pos, state); } // This is a hack to make saplings grow faster if the block underneath the dirt is glass. Useful for testing /*if (world.getBlockState(pos.down(2)) == Blocks.GLASS.getDefaultState()) { te.timer -= 10; te.markDirty(); TerraFirmaCraft.getLog().info("Hacking the timer! New time:" + te.getHoursSincePlaced()); }*/ } } }
@Override public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) { super.updateTick(world, pos, state, rand); if (world.getLightFromNeighbors(pos.up()) >= 9) { int i = state.getValue(this.getAgeProperty()); if (i < this.getMaxAge()) { float f = getGrowthChance(this, world, pos); if (rand.nextInt((int) (25.0F / f) + 1) == 0) { world.setBlockState(pos, state.withProperty(this.getAgeProperty(), i + 1), 2); } } } }