-
Notifications
You must be signed in to change notification settings - Fork 754
/
EquipLogic.java
58 lines (48 loc) · 1.05 KB
/
EquipLogic.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package tconstruct.blocks.logic;
import mantle.blocks.abstracts.InventoryLogic;
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];
}
@Override
public void setInventorySlotContents (int slot, ItemStack stack)
{
if (slot == 0)
{
return;
}
else
{
super.setInventorySlotContents(slot, stack);
}
}
@Override
public ItemStack getStackInSlot (int slot)
{
return slot != 0 ? inventory[slot] : null;
}
public boolean isStackInSlot (int slot)
{
return slot != 0 ? inventory[slot] != null : false;
}
}