Java Code Examples for net.minecraft.init.Blocks#LEAVES2

The following examples show how to use net.minecraft.init.Blocks#LEAVES2 . 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
private boolean isGroundBlock(IBlockState blockState) {
	if (blockState == null || blockState.getBlock() == Blocks.LEAVES || blockState.getBlock() == Blocks.LEAVES2 || blockState.getBlock() == Blocks.LOG || blockState.getBlock() == Blocks.LOG2
			|| blockState.getBlock() instanceof BlockBush) {
		return false;
	}
	return blockState.isOpaqueCube();
}
 
Example 2
private boolean isGroundBlock(IBlockState blockState) {

		if (blockState.getBlock() == Blocks.LEAVES || blockState.getBlock() == Blocks.LEAVES2 || blockState.getBlock() == Blocks.LOG || blockState.getBlock() instanceof BlockBush) {
			return false;
		}

		return blockState.isOpaqueCube();
	}
 
Example 3
public static Block getBlockId(Wood type){
	switch(type){
	case OAK: return Blocks.LEAVES;
	case SPRUCE: return Blocks.LEAVES;
	case BIRCH: return Blocks.LEAVES;
	case JUNGLE: return Blocks.LEAVES;
	case ACACIA: return Blocks.LEAVES2;
	case DARKOAK: return Blocks.LEAVES2;
	default: return Blocks.LOG;
	}
}
 
Example 4
Source Project: Sakura_mod   File: BlockChestnut.java    License: MIT License 4 votes vote down vote up
private boolean isSuitableSoilBlock(Block leafBlock) {
	return leafBlock == Blocks.LEAVES || leafBlock == Blocks.LEAVES2;
}
 
Example 5
private boolean isGroundBlock(IBlockState blockState) {
	if (blockState.getBlock() == Blocks.LEAVES || blockState.getBlock() == Blocks.LEAVES2 || blockState.getBlock() == Blocks.LOG || blockState.getBlock() instanceof BlockBush) {
		return false;
	}
	return blockState.isOpaqueCube();
}
 
Example 6
private boolean isGroundBlock(IBlockState blockState) {
	if (blockState.getBlock() == Blocks.LEAVES || blockState.getBlock() == Blocks.LEAVES2 || blockState.getBlock() == Blocks.LOG || blockState.getBlock() instanceof BlockBush) {
		return false;
	}
	return blockState.isOpaqueCube();
}
 
Example 7
private boolean isGroundBlock(IBlockState blockState) {
	if (blockState.getBlock() == Blocks.LEAVES || blockState.getBlock() == Blocks.LEAVES2 || blockState.getBlock() == Blocks.LOG || blockState.getBlock() instanceof BlockBush) {
		return false;
	}
	return blockState.isOpaqueCube();
}
 
Example 8
protected static boolean isGroundBlock(IBlockState blockState) {
	if (blockState.getBlock() == Blocks.LEAVES || blockState.getBlock() == Blocks.LEAVES2 || blockState.getBlock() == Blocks.LOG || blockState.getBlock() instanceof BlockBush) {
		return false;
	}
	return blockState.isOpaqueCube();
}
 
Example 9
protected static boolean cantBuildOver(IBlockState blockState) {
	if (blockState.getBlock() == Blocks.LEAVES || blockState.getBlock() == Blocks.LEAVES2 || blockState.getBlock() instanceof BlockBush) {
		return false;
	}
	return blockState.isOpaqueCube();
}
 
Example 10
private boolean isGroundBlock(IBlockState blockState) {
	if (blockState.getBlock() == Blocks.LEAVES || blockState.getBlock() == Blocks.LEAVES2 || blockState.getBlock() instanceof BlockBush) {
		return false;
	}
	return blockState.isOpaqueCube();
}
 
Example 11
Source Project: ExNihiloAdscensio   File: TileInfestedLeaves.java    License: MIT License 4 votes vote down vote up
@Override
public void update()
{
    if (progress < 1.0F)
    {
        progress += 1.0 / Config.infestedLeavesTicks;
        markDirty();
        
        if (progress > 1.0F)
        {
            progress = 1.0F;
            
            world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 3);
        }
    }
    
    // Don't update unless there's leaves nearby, or we haven't checked for leavesUpdateFrequency ticks. And only update on the server
    if (!world.isRemote && hasNearbyLeaves || world.getTotalWorldTime() % Config.leavesUpdateFrequency == updateIndex)
    {
        hasNearbyLeaves = false;
        
        for (int x = -1; x <= 1; x++)
        {
            for (int y = -1; y <= 1; y++)
            {
                for (int z = -1; z <= 1; z++)
                {
                    BlockPos newPos = new BlockPos(pos.add(x, y, z));
                    IBlockState state = world.getBlockState(newPos);
                    
                    if (state != null && state.getBlock() != null && (state.getBlock() == Blocks.LEAVES || state.getBlock() == Blocks.LEAVES2))
                    {
                        hasNearbyLeaves = true;
                        
                        if (world.rand.nextFloat() < Config.leavesSpreadChance)
                        {
                            BlockInfestedLeaves.infestLeafBlock(world, newPos);
                        }
                    }
                }
            }
        }
    }
}
 
Example 12
private boolean isGroundBlock(IBlockState blockState) {

		if (blockState.getBlock() == Blocks.LEAVES || blockState.getBlock() == Blocks.LEAVES2 || blockState.getBlock() == Blocks.LOG || blockState.getBlock() instanceof BlockBush) {
			return false;
		}

		return blockState.isOpaqueCube();

	}
 
Example 13
private boolean isGroundBlock(IBlockState blockState) {

		if (blockState.getBlock() == Blocks.LEAVES || blockState.getBlock() == Blocks.LEAVES2 || blockState.getBlock() == Blocks.LOG
				|| blockState.getBlock() instanceof BlockBush) {
			return false;
		}

		return blockState.isOpaqueCube();

	}