Java Code Examples for net.minecraft.world.World#isDaytime()

The following examples show how to use net.minecraft.world.World#isDaytime() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: Sakura_mod   File: BlockHalfTatami.java    License: MIT License 5 votes vote down vote up
@Override
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
	if(worldIn.canBlockSeeSky(pos)&&worldIn.isDaytime()){
			worldIn.setBlockState(pos, (isNS?BlockLoader.TATAMI_TAN_NS_HALF:BlockLoader.TATAMI_TAN_HALF).getDefaultState().withProperty(FACING, state.getValue(FACING)));
	}
	super.updateTick(worldIn, pos, state, rand);
}
 
Example 2
Source Project: Sakura_mod   File: BlockCarpetTatami.java    License: MIT License 5 votes vote down vote up
@Override
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
	if(worldIn.canBlockSeeSky(pos)&&worldIn.isDaytime()){
			worldIn.setBlockState(pos, (isNS?BlockLoader.TATAMI_TAN_NS_CARPET:BlockLoader.TATAMI_TAN_CARPET).getDefaultState().withProperty(FACING, state.getValue(FACING)));
	}
	super.updateTick(worldIn, pos, state, rand);
}
 
Example 3
Source Project: Sakura_mod   File: BlockBambooBlock.java    License: MIT License 5 votes vote down vote up
@Override
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
	if(!isSunburnt&&(worldIn.canBlockSeeSky(pos)||worldIn.getBlockState(pos.up()).getBlock() instanceof BlockBambooBlock)&&worldIn.isDaytime()){
			worldIn.setBlockState(pos, (BlockLoader.BAMBOO_BLOCK_SUNBURNT).getDefaultState().withProperty(LOG_AXIS, state.getValue(LOG_AXIS)));
	}
	super.updateTick(worldIn, pos, state, rand);
}
 
Example 4
Source Project: Sakura_mod   File: BlockTatami.java    License: MIT License 5 votes vote down vote up
@Override
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
	if(worldIn.canBlockSeeSky(pos)&&worldIn.isDaytime()){
			worldIn.setBlockState(pos, (isNS?BlockLoader.TATAMI_TAN_NS:BlockLoader.TATAMI_TAN).getDefaultState().withProperty(FACING, state.getValue(FACING)));
	}
	super.updateTick(worldIn, pos, state, rand);
}
 
Example 5
private boolean canSeeSunClearly(World world, BlockPos blockPos) {
    if (!world.canSeeSky(blockPos)) {
        return false;
    }
    if (world.isRaining()) {
        Biome biome = world.getBiome(blockPos);
        if (biome.canRain() || biome.getEnableSnow()) {
            return false;
        }
    }
    return world.isDaytime();
}
 
Example 6
@Override
public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random) {
    int lightLevel = (worldIn.canSeeSky(pos) && worldIn.isDaytime()) ? 16 : worldIn.getLight(pos);
    if (random.nextInt(20 - lightLevel) == 0) {
        worldIn.setBlockState(pos, getPetrifiedBlock(state));
    }
}