package hmggirlfront.gui;
 
import hmggirlfront.mod_GirlFront;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
 
public class GFSlot extends Slot
{
	
	private IInventory inv;
	private int id = 0;
	
    public GFSlot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_)
    {
        super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_);
        id = p_i1824_2_;
        inv = p_i1824_1_;
    }
 
    /**
     * Check if the stack is allowed to be placed in this slot, used for armor slots as well as furnace fuel.
     */
    public boolean isItemValid(ItemStack stack)
    {
    	boolean idd = !(getHasStack() && getStack().getItem() == mod_GirlFront.idoll_hp);
    	if(id == 0) {
   		 //idd = (getHasStack() && getStack().getItem() == mod_GirlFront.idoll_hp);
    		idd = (!stack.isEmpty() && stack.getItem() == mod_GirlFront.idoll_hp);
   		 }
		if (id == 1) {
			idd = (!stack.isEmpty() && stack.getItem() == mod_GirlFront.idoll_bullet);
		}
		if (id == 2) {
			idd = (!stack.isEmpty() && stack.getItem() == mod_GirlFront.idoll_food);
		}
		if (id == 3) {
			idd = (!stack.isEmpty() && stack.getItem() == mod_GirlFront.idoll_parts);
		}
		if (id == 4) {
			idd = (!stack.isEmpty() && stack.getItem() == mod_GirlFront.idoll_doll_contract);
		}
		if (id == 5) {
			idd = (!stack.isEmpty() && stack.getItem() == mod_GirlFront.idoll_doll_rapidcontract);
		}
		if(!inv.getStackInSlot(7).isEmpty() && id != 5) {
			idd = false;
		}
        //return TileEntityFurnace.isItemFuel(stack) || isBucket(stack);
    	return idd;
    }
    
    /*
        このアイテムは動かせない、つかめないようにする。
     */
    /*@Override
    public boolean canTakeStack(EntityPlayer p_82869_1_)
    {
    	boolean idd = !(getHasStack() && getStack().getItem() == mod_GirlFront.idoll_hp);
    	if(id == 0) {
    		 idd = !(getHasStack() && getStack().getItem() == mod_GirlFront.idoll_hp);
    	}
		if (id == 1) {
			idd = !(getHasStack() && getStack().getItem() == mod_GirlFront.idoll_bullet);
		}
		if (id == 2) {
			idd = !(getHasStack() && getStack().getItem() == mod_GirlFront.idoll_food);
		}
		if (id == 3) {
			idd = !(getHasStack() && getStack().getItem() == mod_GirlFront.idoll_parts);
		}
		if (id == 4) {
			idd = !(getHasStack() && getStack().getItem() == mod_GirlFront.idoll_doll_contract);
		}
		if (id == 5) {
			idd = !(getHasStack() && getStack().getItem() == mod_GirlFront.idoll_doll_rapidcontract);
		}
    	
    	return idd;
        
    }*/
 
}