YATS/Forge Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
net.minecraft.entity.player.InventoryPlayer Class Reference
Inheritance diagram for net.minecraft.entity.player.InventoryPlayer:
net.minecraft.inventory.IInventory

Public Member Functions

 InventoryPlayer (EntityPlayer par1EntityPlayer)
 
ItemStack getCurrentItem ()
 
int getFirstEmptyStack ()
 
void setCurrentItem (int par1, int par2, boolean par3, boolean par4)
 
void changeCurrentItem (int par1)
 
int clearInventory (int par1, int par2)
 
void func_70439_a (Item par1Item, int par2)
 
void decrementAnimations ()
 
boolean consumeInventoryItem (int par1)
 
boolean hasItem (int par1)
 
boolean addItemStackToInventory (ItemStack par1ItemStack)
 
ItemStack decrStackSize (int par1, int par2)
 
ItemStack getStackInSlotOnClosing (int par1)
 
void setInventorySlotContents (int par1, ItemStack par2ItemStack)
 
float getStrVsBlock (Block par1Block)
 
NBTTagList writeToNBT (NBTTagList par1NBTTagList)
 
void readFromNBT (NBTTagList par1NBTTagList)
 
int getSizeInventory ()
 
ItemStack getStackInSlot (int par1)
 
String getInvName ()
 
boolean isInvNameLocalized ()
 
int getInventoryStackLimit ()
 
int getDamageVsEntity (Entity par1Entity)
 
boolean canHarvestBlock (Block par1Block)
 
ItemStack armorItemInSlot (int par1)
 
int getTotalArmorValue ()
 
void damageArmor (int par1)
 
void dropAllItems ()
 
void onInventoryChanged ()
 
void setItemStack (ItemStack par1ItemStack)
 
ItemStack getItemStack ()
 
boolean isUseableByPlayer (EntityPlayer par1EntityPlayer)
 
boolean hasItemStack (ItemStack par1ItemStack)
 
void openChest ()
 
void closeChest ()
 
boolean isStackValidForSlot (int par1, ItemStack par2ItemStack)
 
void copyInventory (InventoryPlayer par1InventoryPlayer)
 

Static Public Member Functions

static int getHotbarSize ()
 

Public Attributes

ItemStack[] mainInventory = new ItemStack[36]
 
ItemStack[] armorInventory = new ItemStack[4]
 
int currentItem = 0
 
EntityPlayer player
 
boolean inventoryChanged = false
 

Constructor & Destructor Documentation

net.minecraft.entity.player.InventoryPlayer.InventoryPlayer ( EntityPlayer  par1EntityPlayer)

Member Function Documentation

boolean net.minecraft.entity.player.InventoryPlayer.addItemStackToInventory ( ItemStack  par1ItemStack)

Adds the item stack to the inventory, returns false if it is impossible.

ItemStack net.minecraft.entity.player.InventoryPlayer.armorItemInSlot ( int  par1)

returns a player armor item (as itemstack) contained in specified armor slot.

boolean net.minecraft.entity.player.InventoryPlayer.canHarvestBlock ( Block  par1Block)

Returns whether the current item (tool) can harvest from the specified block (actually get a result).

void net.minecraft.entity.player.InventoryPlayer.changeCurrentItem ( int  par1)

Switch the current item to the next one or the previous one

int net.minecraft.entity.player.InventoryPlayer.clearInventory ( int  par1,
int  par2 
)

Clear this player's inventory, using the specified ID and metadata as filters or -1 for no filter.

void net.minecraft.entity.player.InventoryPlayer.closeChest ( )
boolean net.minecraft.entity.player.InventoryPlayer.consumeInventoryItem ( int  par1)

removed one item of specified itemID from inventory (if it is in a stack, the stack size will reduce with 1)

void net.minecraft.entity.player.InventoryPlayer.copyInventory ( InventoryPlayer  par1InventoryPlayer)

Copy the ItemStack contents from another InventoryPlayer instance

void net.minecraft.entity.player.InventoryPlayer.damageArmor ( int  par1)

Damages armor in each slot by the specified amount.

void net.minecraft.entity.player.InventoryPlayer.decrementAnimations ( )

Decrement the number of animations remaining. Only called on client side. This is used to handle the animation of receiving a block.

ItemStack net.minecraft.entity.player.InventoryPlayer.decrStackSize ( int  par1,
int  par2 
)

Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new stack.

Implements net.minecraft.inventory.IInventory.

void net.minecraft.entity.player.InventoryPlayer.dropAllItems ( )

Drop all armor and main inventory items.

void net.minecraft.entity.player.InventoryPlayer.func_70439_a ( Item  par1Item,
int  par2 
)
ItemStack net.minecraft.entity.player.InventoryPlayer.getCurrentItem ( )

Returns the item stack currently held by the player.

int net.minecraft.entity.player.InventoryPlayer.getDamageVsEntity ( Entity  par1Entity)

Return damage vs an entity done by the current held weapon, or 1 if nothing is held

int net.minecraft.entity.player.InventoryPlayer.getFirstEmptyStack ( )

Returns the first item stack that is empty.

static int net.minecraft.entity.player.InventoryPlayer.getHotbarSize ( )
static

Get the size of the player hotbar inventory

int net.minecraft.entity.player.InventoryPlayer.getInventoryStackLimit ( )

Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. Isn't this more of a set than a get?

Implements net.minecraft.inventory.IInventory.

String net.minecraft.entity.player.InventoryPlayer.getInvName ( )

Returns the name of the inventory.

Implements net.minecraft.inventory.IInventory.

ItemStack net.minecraft.entity.player.InventoryPlayer.getItemStack ( )
int net.minecraft.entity.player.InventoryPlayer.getSizeInventory ( )

Returns the number of slots in the inventory.

Implements net.minecraft.inventory.IInventory.

ItemStack net.minecraft.entity.player.InventoryPlayer.getStackInSlot ( int  par1)

Returns the stack in slot i

Implements net.minecraft.inventory.IInventory.

ItemStack net.minecraft.entity.player.InventoryPlayer.getStackInSlotOnClosing ( int  par1)

When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like when you close a workbench GUI.

Implements net.minecraft.inventory.IInventory.

float net.minecraft.entity.player.InventoryPlayer.getStrVsBlock ( Block  par1Block)

Gets the strength of the current item (tool) against the specified block, 1.0f if not holding anything.

int net.minecraft.entity.player.InventoryPlayer.getTotalArmorValue ( )

Based on the damage values and maximum damage values of each armor item, returns the current armor value.

boolean net.minecraft.entity.player.InventoryPlayer.hasItem ( int  par1)

Get if a specifiied item id is inside the inventory.

boolean net.minecraft.entity.player.InventoryPlayer.hasItemStack ( ItemStack  par1ItemStack)

Returns true if the specified ItemStack exists in the inventory.

boolean net.minecraft.entity.player.InventoryPlayer.isInvNameLocalized ( )

If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's language. Otherwise it will be used directly.

Implements net.minecraft.inventory.IInventory.

boolean net.minecraft.entity.player.InventoryPlayer.isStackValidForSlot ( int  par1,
ItemStack  par2ItemStack 
)

Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.

Implements net.minecraft.inventory.IInventory.

boolean net.minecraft.entity.player.InventoryPlayer.isUseableByPlayer ( EntityPlayer  par1EntityPlayer)

Do not make give this method the name canInteractWith because it clashes with Container

Implements net.minecraft.inventory.IInventory.

void net.minecraft.entity.player.InventoryPlayer.onInventoryChanged ( )

Called when an the contents of an Inventory change, usually

Implements net.minecraft.inventory.IInventory.

void net.minecraft.entity.player.InventoryPlayer.openChest ( )
void net.minecraft.entity.player.InventoryPlayer.readFromNBT ( NBTTagList  par1NBTTagList)

Reads from the given tag list and fills the slots in the inventory with the correct items.

void net.minecraft.entity.player.InventoryPlayer.setCurrentItem ( int  par1,
int  par2,
boolean  par3,
boolean  par4 
)

Sets a specific itemID as the current item being held (only if it exists on the hotbar)

void net.minecraft.entity.player.InventoryPlayer.setInventorySlotContents ( int  par1,
ItemStack  par2ItemStack 
)

Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).

Implements net.minecraft.inventory.IInventory.

void net.minecraft.entity.player.InventoryPlayer.setItemStack ( ItemStack  par1ItemStack)
NBTTagList net.minecraft.entity.player.InventoryPlayer.writeToNBT ( NBTTagList  par1NBTTagList)

Writes the inventory out as a list of compound tags. This is where the slot indices are used (+100 for armor, +80 for crafting).

Member Data Documentation

ItemStack [] net.minecraft.entity.player.InventoryPlayer.armorInventory = new ItemStack[4]

An array of 4 item stacks containing the currently worn armor pieces.

int net.minecraft.entity.player.InventoryPlayer.currentItem = 0

The index of the currently held item (0-8).

boolean net.minecraft.entity.player.InventoryPlayer.inventoryChanged = false

Set true whenever the inventory changes. Nothing sets it false so you will have to write your own code to check it and reset the value.

ItemStack [] net.minecraft.entity.player.InventoryPlayer.mainInventory = new ItemStack[36]

An array of 36 item stacks indicating the main player inventory (including the visible bar).

EntityPlayer net.minecraft.entity.player.InventoryPlayer.player

The player whose inventory this is.


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