YATS/Forge Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
net.minecraft.inventory.Slot Class Reference
Inheritance diagram for net.minecraft.inventory.Slot:
net.minecraft.inventory.SlotCrafting net.minecraft.inventory.SlotFurnace net.minecraft.inventory.SlotMerchantResult

Public Member Functions

 Slot (IInventory par1IInventory, int par2, int par3, int par4)
 
void onSlotChange (ItemStack par1ItemStack, ItemStack par2ItemStack)
 
void onPickupFromSlot (EntityPlayer par1EntityPlayer, ItemStack par2ItemStack)
 
boolean isItemValid (ItemStack par1ItemStack)
 
ItemStack getStack ()
 
boolean getHasStack ()
 
void putStack (ItemStack par1ItemStack)
 
void onSlotChanged ()
 
int getSlotStackLimit ()
 
ItemStack decrStackSize (int par1)
 
boolean isSlotInInventory (IInventory par1IInventory, int par2)
 
boolean canTakeStack (EntityPlayer par1EntityPlayer)
 
Icon getBackgroundIconIndex ()
 
String getBackgroundIconTexture ()
 
void setBackgroundIconIndex (Icon icon)
 
void setBackgroundIconTexture (String textureFilename)
 
int getSlotIndex ()
 

Public Attributes

final IInventory inventory
 
int slotNumber
 
int xDisplayPosition
 
int yDisplayPosition
 

Protected Member Functions

void onCrafting (ItemStack par1ItemStack, int par2)
 
void onCrafting (ItemStack par1ItemStack)
 

Protected Attributes

Icon backgroundIcon = null
 
String texture = "/gui/items.png"
 

Constructor & Destructor Documentation

net.minecraft.inventory.Slot.Slot ( IInventory  par1IInventory,
int  par2,
int  par3,
int  par4 
)

Member Function Documentation

boolean net.minecraft.inventory.Slot.canTakeStack ( EntityPlayer  par1EntityPlayer)

Return whether this slot's stack can be taken from this slot.

ItemStack net.minecraft.inventory.Slot.decrStackSize ( int  par1)

Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new stack.

Icon net.minecraft.inventory.Slot.getBackgroundIconIndex ( )

Returns the icon index on items.png that is used as background image of the slot.

String net.minecraft.inventory.Slot.getBackgroundIconTexture ( )

Gets the path of the texture file to use for the background image of this slot when drawing the GUI.

Returns
String: The texture file that will be used in GuiContainer.drawSlotInventory for the slot background.
boolean net.minecraft.inventory.Slot.getHasStack ( )

Returns if this slot contains a stack.

int net.minecraft.inventory.Slot.getSlotIndex ( )

Retrieves the index in the inventory for this slot, this value should typically not be used, but can be useful for some occasions.

Returns
Index in associated inventory for this slot.
int net.minecraft.inventory.Slot.getSlotStackLimit ( )

Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case of armor slots)

ItemStack net.minecraft.inventory.Slot.getStack ( )

Helper fnct to get the stack in the slot.

boolean net.minecraft.inventory.Slot.isItemValid ( ItemStack  par1ItemStack)

Check if the stack is a valid item for this slot. Always true beside for the armor slots.

boolean net.minecraft.inventory.Slot.isSlotInInventory ( IInventory  par1IInventory,
int  par2 
)

returns true if this slot is in par2 of par1

void net.minecraft.inventory.Slot.onCrafting ( ItemStack  par1ItemStack,
int  par2 
)
protected

the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an internal count then calls onCrafting(item).

void net.minecraft.inventory.Slot.onCrafting ( ItemStack  par1ItemStack)
protected

the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.

void net.minecraft.inventory.Slot.onPickupFromSlot ( EntityPlayer  par1EntityPlayer,
ItemStack  par2ItemStack 
)
void net.minecraft.inventory.Slot.onSlotChange ( ItemStack  par1ItemStack,
ItemStack  par2ItemStack 
)

if par2 has more items than par1, onCrafting(item,countIncrease) is called

void net.minecraft.inventory.Slot.onSlotChanged ( )

Called when the stack in a Slot changes

void net.minecraft.inventory.Slot.putStack ( ItemStack  par1ItemStack)

Helper method to put a stack in the slot.

void net.minecraft.inventory.Slot.setBackgroundIconIndex ( Icon  icon)

Sets which icon index to use as the background image of the slot when it's empty.

Parameters
iconThe icon to use, null for none
void net.minecraft.inventory.Slot.setBackgroundIconTexture ( String  textureFilename)

Sets the texture file to use for the background image of the slot when it's empty.

Parameters
textureFilenameString: Path of texture file to use, or null to use "/gui/items.png"

Member Data Documentation

Icon net.minecraft.inventory.Slot.backgroundIcon = null
protected

Position within background texture file, normally -1 which causes no background to be drawn.

final IInventory net.minecraft.inventory.Slot.inventory

The inventory we want to extract a slot from.

int net.minecraft.inventory.Slot.slotNumber

the id of the slot(also the index in the inventory arraylist)

String net.minecraft.inventory.Slot.texture = "/gui/items.png"
protected

Background texture file assigned to this slot, if any. Vanilla "/gui/items.png" is used if this is null.

int net.minecraft.inventory.Slot.xDisplayPosition

display position of the inventory slot on the screen x axis

int net.minecraft.inventory.Slot.yDisplayPosition

display position of the inventory slot on the screen y axis


The documentation for this class was generated from the following file: