// Path: src/api/java/appeng/api/implementations/tiles/IChestOrDrive.java
// public interface IChestOrDrive extends ICellContainer, IGridHost, IOrientable
// {
// 
// 	/**
// 	 * @return how many slots are available. Chest has 1, Drive has 10.
// 	 */
// 	int getCellCount();
// 
// 	/**
// 	 * 0 - cell is missing.
// 	 * 
// 	 * 1 - green,
// 	 * 
// 	 * 2 - orange,
// 	 * 
// 	 * 3 - red
// 	 * 
// 	 * @param slot
// 	 * @return status of the slot, one of the above indices.
// 	 */
// 	int getCellStatus(int slot);
// 
// 	/**
// 	 * @return if the device is online you should check this before providing any other information.
// 	 */
// 	boolean isPowered();
// 
// 	/**
// 	 * @param slot
// 	 * @return is the cell currently blinking to show activity.
// 	 */
// 	boolean isCellBlinking(int slot);
// 
// }


import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import appeng.api.implementations.tiles.IChestOrDrive;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
package appeng.api.storage;


/**
 * Registration record for {@link ICellRegistry}
 */
public interface ICellHandler
{

	/**
	 * return true if the provided item is handled by your cell handler. ( AE May choose to skip this method, and just
	 * request a handler )
	 * 
	 * @param is
	 * @return return true, if getCellHandler will not return null.
	 */
	boolean isCell(ItemStack is);

	/**
	 * If you cannot handle the provided item, return null
	 * 
	 * @param is
	 *            a storage cell item.
	 * 
	 * @return a new IMEHandler for the provided item
	 */
	IMEInventoryHandler getCellInventory(ItemStack is, StorageChannel channel);

	/**
	 * @return the ME Chest texture for this storage cell type, should be 10x10 with 3px of transparent padding on a
	 *         16x16 texture, null is valid if your cell cannot be used in the ME Chest. refer to the assets for
	 *         examples and colors.
	 */
	@SideOnly(Side.CLIENT)
	IIcon getTopTexture();

	/**
	 * 
	 * Called when the storage cell is planed in an ME Chest and the user tries to open the terminal side, if your item
	 * is not available via ME Chests simply tell the user they can't use it, or something, other wise you should open
	 * your gui and display the cell to the user.
	 * 
	 * @param player
	 * @param chest
	 * @param cellHandler
	 * @param inv
	 * @param is
	 * @param chan
	 */
// Path: src/api/java/appeng/api/implementations/tiles/IChestOrDrive.java
// public interface IChestOrDrive extends ICellContainer, IGridHost, IOrientable
// {
// 
// 	/**
// 	 * @return how many slots are available. Chest has 1, Drive has 10.
// 	 */
// 	int getCellCount();
// 
// 	/**
// 	 * 0 - cell is missing.
// 	 * 
// 	 * 1 - green,
// 	 * 
// 	 * 2 - orange,
// 	 * 
// 	 * 3 - red
// 	 * 
// 	 * @param slot
// 	 * @return status of the slot, one of the above indices.
// 	 */
// 	int getCellStatus(int slot);
// 
// 	/**
// 	 * @return if the device is online you should check this before providing any other information.
// 	 */
// 	boolean isPowered();
// 
// 	/**
// 	 * @param slot
// 	 * @return is the cell currently blinking to show activity.
// 	 */
// 	boolean isCellBlinking(int slot);
// 
// }


// Path: src/api/java/appeng/api/storage/ICellHandler.java
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import appeng.api.implementations.tiles.IChestOrDrive;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

package appeng.api.storage;


/**
 * Registration record for {@link ICellRegistry}
 */
public interface ICellHandler
{

	/**
	 * return true if the provided item is handled by your cell handler. ( AE May choose to skip this method, and just
	 * request a handler )
	 * 
	 * @param is
	 * @return return true, if getCellHandler will not return null.
	 */
	boolean isCell(ItemStack is);

	/**
	 * If you cannot handle the provided item, return null
	 * 
	 * @param is
	 *            a storage cell item.
	 * 
	 * @return a new IMEHandler for the provided item
	 */
	IMEInventoryHandler getCellInventory(ItemStack is, StorageChannel channel);

	/**
	 * @return the ME Chest texture for this storage cell type, should be 10x10 with 3px of transparent padding on a
	 *         16x16 texture, null is valid if your cell cannot be used in the ME Chest. refer to the assets for
	 *         examples and colors.
	 */
	@SideOnly(Side.CLIENT)
	IIcon getTopTexture();

	/**
	 * 
	 * Called when the storage cell is planed in an ME Chest and the user tries to open the terminal side, if your item
	 * is not available via ME Chests simply tell the user they can't use it, or something, other wise you should open
	 * your gui and display the cell to the user.
	 * 
	 * @param player
	 * @param chest
	 * @param cellHandler
	 * @param inv
	 * @param is
	 * @param chan
	 */
	void openChestGui(EntityPlayer player, IChestOrDrive chest, ICellHandler cellHandler, IMEInventoryHandler inv, ItemStack is, StorageChannel chan);