forked from dfu/MineColony
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSlotRestricted.java
58 lines (51 loc) · 1.26 KB
/
SlotRestricted.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 net.minecraft.src;
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
public class SlotRestricted extends Slot
{
public SlotRestricted(IInventory iinventory, int i, int j, int k,
boolean canBeFilled, Item validItem)
{
super(iinventory, i, j, k);
inventory = iinventory;
slotIndex = i;
this.canBeFilled = canBeFilled;
this.validItem = validItem;
}
public boolean isItemValid(ItemStack itemstack)
{
if(this.validItem == null)
{
return true;
}
else
{
if(itemstack.getItem().getItemName() == this.validItem.getItemName()
&& this.canBeFilled == true)
{
return true;
}
return false;
}
}
public void putStack(ItemStack itemstack)
{
if(this.canBeFilled)
{
inventory.setInventorySlotContents(slotIndex, itemstack);
onSlotChanged();
}
}
public int getSlotStackLimit()
{
return inventory.getInventoryStackLimit();
}
private final boolean canBeFilled;
private final Item validItem;
private final int slotIndex;
private final IInventory inventory;
public int field_20007_a;
public int xDisplayPosition;
public int yDisplayPosition;
}