2013-07-26 21:18:53 -07:00
|
|
|
package tconstruct.blocks.logic;
|
|
|
|
|
|
2013-12-01 12:19:43 +00:00
|
|
|
import mantle.blocks.abstracts.InventoryLogic;
|
2013-07-26 21:18:53 -07:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
|
|
|
|
|
/* Slots
|
|
|
|
|
* 0: Frying pan item
|
|
|
|
|
* 1: Fuel
|
|
|
|
|
* 2-9: Food
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public abstract class EquipLogic extends InventoryLogic
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public EquipLogic(int invSize)
|
|
|
|
|
{
|
|
|
|
|
super(invSize);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setEquipmentItem (ItemStack stack)
|
|
|
|
|
{
|
|
|
|
|
inventory[0] = stack.copy();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean hasEquipmentItem ()
|
|
|
|
|
{
|
|
|
|
|
return inventory[0] != null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ItemStack getEquipmentItem ()
|
|
|
|
|
{
|
|
|
|
|
return inventory[0];
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-08 18:51:19 +10:00
|
|
|
@Override
|
2013-11-10 13:57:35 -08:00
|
|
|
public void setInventorySlotContents (int slot, ItemStack stack)
|
|
|
|
|
{
|
|
|
|
|
if (slot == 0)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
super.setInventorySlotContents(slot, stack);
|
|
|
|
|
}
|
2013-09-08 18:51:19 +10:00
|
|
|
}
|
2013-11-10 13:57:35 -08:00
|
|
|
|
2013-09-08 18:51:19 +10:00
|
|
|
@Override
|
2013-11-10 13:57:35 -08:00
|
|
|
public ItemStack getStackInSlot (int slot)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
2013-09-08 18:51:19 +10:00
|
|
|
return slot != 0 ? inventory[slot] : null;
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
2013-11-10 13:57:35 -08:00
|
|
|
|
|
|
|
|
public boolean isStackInSlot (int slot)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
2013-11-10 13:57:35 -08:00
|
|
|
return slot != 0 ? inventory[slot] != null : false;
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
}
|