GT5-Unofficial/src/main/java/gregtech/api/gui/GT_Slot_Holo.java

47 lines
1.2 KiB
Java
Raw Normal View History

2015-04-23 16:14:22 +00:00
package gregtech.api.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class GT_Slot_Holo extends Slot {
public final int mSlotIndex;
2015-10-22 02:06:25 +00:00
public boolean mCanInsertItem, mCanStackItem;
public int mMaxStacksize = 127;
public GT_Slot_Holo(IInventory par1iInventory, int par2, int par3, int par4, boolean aCanInsertItem, boolean aCanStackItem, int aMaxStacksize) {
super(par1iInventory, par2, par3, par4);
mCanInsertItem = aCanInsertItem;
mCanStackItem = aCanStackItem;
mMaxStacksize = aMaxStacksize;
mSlotIndex = par2;
}
2015-04-23 16:14:22 +00:00
@Override
2015-10-22 02:06:25 +00:00
public boolean isItemValid(ItemStack par1ItemStack) {
2015-04-23 16:14:22 +00:00
return mCanInsertItem;
}
2015-10-22 02:06:25 +00:00
2015-04-23 16:14:22 +00:00
@Override
2015-10-22 02:06:25 +00:00
public int getSlotStackLimit() {
2015-04-23 16:14:22 +00:00
return mMaxStacksize;
}
2015-10-22 02:06:25 +00:00
2015-04-23 16:14:22 +00:00
@Override
2015-10-22 02:06:25 +00:00
public boolean getHasStack() {
2015-04-23 16:14:22 +00:00
return false;
}
2015-10-22 02:06:25 +00:00
2015-04-23 16:14:22 +00:00
@Override
2015-10-22 02:06:25 +00:00
public ItemStack decrStackSize(int par1) {
if (!mCanStackItem) return null;
2015-04-23 16:14:22 +00:00
return super.decrStackSize(par1);
}
2015-10-22 02:06:25 +00:00
2015-04-23 16:14:22 +00:00
@Override
public boolean canTakeStack(EntityPlayer par1EntityPlayer) {
return false;
}
}