Added slot prefab for energy items

This commit is contained in:
DarkGuardsman 2013-12-31 14:19:52 -05:00
parent 02a0000be1
commit b318c077fa

View file

@ -0,0 +1,24 @@
package com.builtbroken.minecraft.prefab.invgui;
import universalelectricity.api.CompatibilityModule;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
/** Slot designed to only allow batery like items
*
* @author DarkGuardsman */
public class SlotEnergyItem extends Slot
{
public SlotEnergyItem(IInventory inventory, int slotID, int xPos, int yPos)
{
super(inventory, slotID, xPos, yPos);
}
@Override
public boolean isItemValid(ItemStack compareStack)
{
return compareStack != null && CompatibilityModule.isHandler(compareStack.getItem());
}
}