public class InventoryBackpack
extends java.lang.Object
implements net.minecraft.inventory.IInventory
| Constructor and Description |
|---|
InventoryBackpack(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.item.ItemStack itemStack,
BackpackTypes type) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
closeInventory(net.minecraft.entity.player.EntityPlayer player) |
net.minecraft.item.ItemStack |
decrStackSize(int slotIndex,
int amount) |
java.lang.String |
getCommandSenderName() |
net.minecraft.util.IChatComponent |
getDisplayName() |
int |
getField(int id) |
int |
getFieldCount() |
int |
getInventoryStackLimit() |
int |
getSizeInventory() |
net.minecraft.item.ItemStack |
getStackInSlot(int slotIndex) |
net.minecraft.item.ItemStack |
getStackInSlotOnClosing(int index) |
BackpackTypes |
getType() |
boolean |
hasCustomName() |
boolean |
isEmpty()
Checks if the backpack contains any items
|
boolean |
isItemValidForSlot(int index,
net.minecraft.item.ItemStack itemStack) |
boolean |
isUseableByPlayer(net.minecraft.entity.player.EntityPlayer player) |
void |
markDirty() |
void |
onGuiSaved(net.minecraft.entity.player.EntityPlayer entityPlayer)
Called from the container and saves the backpack.
|
void |
openInventory(net.minecraft.entity.player.EntityPlayer player) |
void |
readFromNBT(net.minecraft.nbt.NBTTagCompound nbtTagCompound)
Loads in the data stored in the NBT of this stack and puts the items in their respective slots.
|
void |
save()
Updates the NBT data of the itemstack to save it
|
void |
saveWithSideCheck(net.minecraft.entity.player.EntityPlayer player)
Saves the backpack (on the server side only)
|
void |
setField(int id,
int value) |
void |
setInventorySlotContents(int slotIndex,
net.minecraft.item.ItemStack itemStack) |
void |
writeToNBT(net.minecraft.nbt.NBTTagCompound nbtTagCompound)
Writes the data of the backpack to NBT form.
|
public InventoryBackpack(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.item.ItemStack itemStack,
BackpackTypes type)
public BackpackTypes getType()
public int getSizeInventory()
getSizeInventory in interface net.minecraft.inventory.IInventorypublic net.minecraft.item.ItemStack getStackInSlot(int slotIndex)
getStackInSlot in interface net.minecraft.inventory.IInventorypublic net.minecraft.item.ItemStack decrStackSize(int slotIndex,
int amount)
decrStackSize in interface net.minecraft.inventory.IInventorypublic net.minecraft.item.ItemStack getStackInSlotOnClosing(int index)
getStackInSlotOnClosing in interface net.minecraft.inventory.IInventorypublic void setInventorySlotContents(int slotIndex,
net.minecraft.item.ItemStack itemStack)
setInventorySlotContents in interface net.minecraft.inventory.IInventorypublic int getInventoryStackLimit()
getInventoryStackLimit in interface net.minecraft.inventory.IInventorypublic void markDirty()
markDirty in interface net.minecraft.inventory.IInventorypublic boolean isUseableByPlayer(net.minecraft.entity.player.EntityPlayer player)
isUseableByPlayer in interface net.minecraft.inventory.IInventorypublic void openInventory(net.minecraft.entity.player.EntityPlayer player)
openInventory in interface net.minecraft.inventory.IInventorypublic void closeInventory(net.minecraft.entity.player.EntityPlayer player)
closeInventory in interface net.minecraft.inventory.IInventorypublic void clear()
clear in interface net.minecraft.inventory.IInventorypublic boolean isItemValidForSlot(int index,
net.minecraft.item.ItemStack itemStack)
isItemValidForSlot in interface net.minecraft.inventory.IInventorypublic int getField(int id)
getField in interface net.minecraft.inventory.IInventorypublic void setField(int id,
int value)
setField in interface net.minecraft.inventory.IInventorypublic int getFieldCount()
getFieldCount in interface net.minecraft.inventory.IInventorypublic java.lang.String getCommandSenderName()
getCommandSenderName in interface net.minecraft.world.IWorldNameablepublic boolean hasCustomName()
hasCustomName in interface net.minecraft.world.IWorldNameablepublic net.minecraft.util.IChatComponent getDisplayName()
getDisplayName in interface net.minecraft.world.IWorldNameablepublic boolean isEmpty()
public void onGuiSaved(net.minecraft.entity.player.EntityPlayer entityPlayer)
entityPlayer - - the player with the backpackpublic void saveWithSideCheck(net.minecraft.entity.player.EntityPlayer player)
player - - the player with the backpackpublic void save()
public void writeToNBT(net.minecraft.nbt.NBTTagCompound nbtTagCompound)
nbtTagCompound - - the tag compoundpublic void readFromNBT(net.minecraft.nbt.NBTTagCompound nbtTagCompound)
nbtTagCompound - - the tag compound