public class Slot
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected IIcon |
backgroundIcon
Position within background texture file, normally -1 which causes no background to be drawn.
|
IInventory |
inventory |
int |
slotNumber |
protected ResourceLocation |
texture
Background texture file assigned to this slot, if any.
|
int |
xDisplayPosition |
int |
yDisplayPosition |
Constructor and Description |
---|
Slot(IInventory par1IInventory,
int par2,
int par3,
int par4) |
Modifier and Type | Method and Description |
---|---|
boolean |
canTakeStack(EntityPlayer par1EntityPlayer) |
ItemStack |
decrStackSize(int par1) |
boolean |
func_111238_b() |
IIcon |
getBackgroundIconIndex() |
ResourceLocation |
getBackgroundIconTexture()
Gets the path of the texture file to use for the background image of this slot when drawing the GUI.
|
boolean |
getHasStack() |
int |
getSlotIndex()
Retrieves the index in the inventory for this slot, this value should typically not
be used, but can be useful for some occasions.
|
int |
getSlotStackLimit() |
ItemStack |
getStack() |
boolean |
isItemValid(ItemStack par1ItemStack) |
boolean |
isSlotInInventory(IInventory par1IInventory,
int par2) |
protected void |
onCrafting(ItemStack par1ItemStack) |
protected void |
onCrafting(ItemStack par1ItemStack,
int par2) |
void |
onPickupFromSlot(EntityPlayer par1EntityPlayer,
ItemStack par2ItemStack) |
void |
onSlotChange(ItemStack par1ItemStack,
ItemStack par2ItemStack) |
void |
onSlotChanged() |
void |
putStack(ItemStack par1ItemStack) |
void |
setBackgroundIcon(IIcon icon)
Sets which icon index to use as the background image of the slot when it's empty.
|
void |
setBackgroundIconTexture(ResourceLocation texture)
Sets the texture file to use for the background image of the slot when it's empty.
|
public final IInventory inventory
public int slotNumber
public int xDisplayPosition
public int yDisplayPosition
protected IIcon backgroundIcon
protected ResourceLocation texture
public Slot(IInventory par1IInventory, int par2, int par3, int par4)
protected void onCrafting(ItemStack par1ItemStack, int par2)
protected void onCrafting(ItemStack par1ItemStack)
public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack)
public boolean isItemValid(ItemStack par1ItemStack)
public ItemStack getStack()
public boolean getHasStack()
public void putStack(ItemStack par1ItemStack)
public void onSlotChanged()
public int getSlotStackLimit()
public ItemStack decrStackSize(int par1)
public boolean isSlotInInventory(IInventory par1IInventory, int par2)
public boolean canTakeStack(EntityPlayer par1EntityPlayer)
public IIcon getBackgroundIconIndex()
public boolean func_111238_b()
public ResourceLocation getBackgroundIconTexture()
public void setBackgroundIcon(IIcon icon)
icon
- The icon to use, null for nonepublic void setBackgroundIconTexture(ResourceLocation texture)
textureFilename
- String: Path of texture file to use, or null to use "/gui/items.png"public int getSlotIndex()