Package net.minecraft.entity.player
Class InventoryPlayer
- java.lang.Object
-
- net.zxmushroom63.plugins.BaseData
-
- net.zxmushroom63.plugins.PluginData
-
- net.minecraft.entity.player.InventoryPlayer
-
- All Implemented Interfaces:
IInventory
,IWorldNameable
,org.teavm.jso.JSObject
public class InventoryPlayer extends PluginData implements IInventory
+ This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. NOT FOR COMMERCIAL OR MALICIOUS USE (please read the 'LICENSE' file this repo's root directory for more info)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.zxmushroom63.plugins.BaseData
BaseData.BooleanCallback, BaseData.BooleanCallbackArr, BaseData.DataBooleanCallback, BaseData.DataBooleanCallbackArr, BaseData.DataDoubleCallback, BaseData.DataDoubleCallbackArr, BaseData.DataFloatCallback, BaseData.DataFloatCallbackArr, BaseData.DataIntCallback, BaseData.DataIntCallbackArr, BaseData.DataObjectCallback, BaseData.DataObjectCallbackArr, BaseData.DataStringCallback, BaseData.DataStringCallbackArr, BaseData.DataVoidCallback, BaseData.DoubleCallback, BaseData.DoubleCallbackArr, BaseData.FloatCallback, BaseData.FloatCallbackArr, BaseData.IntCallback, BaseData.IntCallbackArr, BaseData.ObjectCallback, BaseData.ObjectCallbackArr, BaseData.StringCallback, BaseData.StringCallbackArr, BaseData.VoidCallback
-
-
Field Summary
Fields Modifier and Type Field Description ItemStack[]
armorInventory
+ An array of 4 item stacks containing the currently worn armor pieces.int
currentItem
boolean
inventoryChanged
ItemStack[]
mainInventory
+ An array of 36 item stacks indicating the main player inventory (including the visible bar).EntityPlayer
player
-
Constructor Summary
Constructors Constructor Description InventoryPlayer(EntityPlayer playerIn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addItemStackToInventory(ItemStack itemStackIn)
+ Adds the item stack to the inventory, returns false if it is impossible.ItemStack
armorItemInSlot(int parInt1)
+ returns a player armor item (as itemstack) contained in specified armor slot.boolean
canHeldItemHarvest(Block blockIn)
void
changeCurrentItem(int parInt1)
+ Switch the current item to the next one or the previous onevoid
clear()
int
clearMatchingItems(Item itemIn, int metadataIn, int removeCount, NBTTagCompound itemNBT)
+ Removes matching items from the inventory.\n@param itemIn The item to match, null ignores.\n@param metadataIn The metadata to match, -1 ignores.\n@param removeCount The number of items to remove.void
closeInventory(EntityPlayer var1)
boolean
consumeInventoryItem(Item itemIn)
+ removed one item of specified Item from inventory (if it is in a stack, the stack size will reduce with 1)void
copyInventory(InventoryPlayer playerInventory)
+ Copy the ItemStack contents from another InventoryPlayer instancevoid
damageArmor(float damage)
+ Damages armor in each slot by the specified amount.void
decrementAnimations()
+ Decrement the number of animations remaining.ItemStack
decrStackSize(int i, int j)
+ Removes up to a specified number of items from an inventory slot and returns them in a new stack.void
dropAllItems()
+ Drop all armor and main inventory items.ItemStack
getCurrentItem()
+ Returns the item stack currently held by the player.IChatComponent
getDisplayName()
+ Get the formatted ChatComponent that will be used for the sender's username in chatint
getField(int var1)
int
getFieldCount()
int
getFirstEmptyStack()
+ Returns the first item stack that is empty.static int
getHotbarSize()
+ Get the size of the player hotbar inventoryint
getInventoryStackLimit()
+ Returns the maximum stack size for a inventory slot.ItemStack
getItemStack()
+ Stack helds by mouse, used in GUI and Containersjava.lang.String
getName()
+ Gets the name of this command sender (usually username, but possibly "Rcon")int
getSizeInventory()
+ Returns the number of slots in the inventory.ItemStack
getStackInSlot(int i)
+ Returns the stack in the given slot.float
getStrVsBlock(Block blockIn)
int
getTotalArmorValue()
+ Based on the damage values and maximum damage values of each armor item, returns the current armor value.boolean
hasCustomName()
+ Returns true if this thing is namedboolean
hasItem(Item itemIn)
+ Checks if a specified Item is inside the inventoryboolean
hasItemStack(ItemStack itemStackIn)
+ Returns true if the specified ItemStack exists in the inventory.boolean
isItemValidForSlot(int var1, ItemStack var2)
+ Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.boolean
isUseableByPlayer(EntityPlayer entityplayer)
+ Do not make give this method the name canInteractWith because it clashes with Containervoid
loadPluginData(BaseData data)
PluginData
makePluginData()
void
markDirty()
+ For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think it hasn't changed and skip it.void
openInventory(EntityPlayer var1)
void
readFromNBT(NBTTagList parNBTTagList)
+ Reads from the given tag list and fills the slots in the inventory with the correct items.ItemStack
removeStackFromSlot(int i)
+ Removes a stack from the given slot and returns it.void
setCurrentItem(Item itemIn, int parInt1, boolean parFlag, boolean parFlag2)
void
setField(int var1, int var2)
void
setInventorySlotContents(int i, ItemStack itemstack)
+ Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).void
setItemStack(ItemStack itemStackIn)
+ Set the stack helds by mouse, used in GUI/ContainerNBTTagList
writeToNBT(NBTTagList parNBTTagList)
+ Writes the inventory out as a list of compound tags.-
Methods inherited from class net.zxmushroom63.plugins.BaseData
execFuncBaseData, execFuncObject, execFuncString, getBaseData, getBaseDataArr, getBoolean, getBooleanArr, getByte, getByteArr, getChar, getCharArr, getDouble, getDoubleArr, getFloat, getFloatArr, getInt, getIntArr, getObject, getObjectArr, getShort, getShortArr, getString, getStringArr, has, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setCallbackBoolean, setCallbackBooleanArr, setCallbackBooleanArrWithDataArg, setCallbackBooleanWithDataArg, setCallbackDouble, setCallbackDoubleArr, setCallbackDoubleArrWithDataArg, setCallbackDoubleWithDataArg, setCallbackFloat, setCallbackFloatArr, setCallbackFloatArrWithDataArg, setCallbackFloatWithDataArg, setCallbackInt, setCallbackIntArr, setCallbackIntArrWithDataArg, setCallbackIntWithDataArg, setCallbackObject, setCallbackObjectArr, setCallbackObjectArrWithDataArg, setCallbackObjectWithDataArg, setCallbackString, setCallbackStringArr, setCallbackStringArrWithDataArg, setCallbackStringWithDataArg, setCallbackVoid, setCallbackVoidWithDataArg, setNull
-
-
-
-
Field Detail
-
mainInventory
public ItemStack[] mainInventory
+ An array of 36 item stacks indicating the main player inventory (including the visible bar).
-
armorInventory
public ItemStack[] armorInventory
+ An array of 4 item stacks containing the currently worn armor pieces.
-
currentItem
public int currentItem
-
player
public EntityPlayer player
-
inventoryChanged
public boolean inventoryChanged
-
-
Constructor Detail
-
InventoryPlayer
public InventoryPlayer(EntityPlayer playerIn)
-
-
Method Detail
-
loadPluginData
public void loadPluginData(BaseData data)
-
makePluginData
public PluginData makePluginData()
-
getCurrentItem
public ItemStack getCurrentItem()
+ Returns the item stack currently held by the player.
-
getHotbarSize
public static int getHotbarSize()
+ Get the size of the player hotbar inventory
-
getFirstEmptyStack
public int getFirstEmptyStack()
+ Returns the first item stack that is empty.
-
setCurrentItem
public void setCurrentItem(Item itemIn, int parInt1, boolean parFlag, boolean parFlag2)
-
changeCurrentItem
public void changeCurrentItem(int parInt1)
+ Switch the current item to the next one or the previous one
-
clearMatchingItems
public int clearMatchingItems(Item itemIn, int metadataIn, int removeCount, NBTTagCompound itemNBT)
+ Removes matching items from the inventory.\n@param itemIn The item to match, null ignores.\n@param metadataIn The metadata to match, -1 ignores.\n@param removeCount The number of items to remove. If less than 1, removes all matching items.\n@param itemNBT The NBT data to match, null ignores.\n@return The number of items removed from the inventory.
-
decrementAnimations
public void decrementAnimations()
+ Decrement the number of animations remaining. Only called on client side. This is used to handle the animation of receiving a block.
-
consumeInventoryItem
public boolean consumeInventoryItem(Item itemIn)
+ removed one item of specified Item from inventory (if it is in a stack, the stack size will reduce with 1)
-
hasItem
public boolean hasItem(Item itemIn)
+ Checks if a specified Item is inside the inventory
-
addItemStackToInventory
public boolean addItemStackToInventory(ItemStack itemStackIn)
+ Adds the item stack to the inventory, returns false if it is impossible.
-
decrStackSize
public ItemStack decrStackSize(int i, int j)
+ Removes up to a specified number of items from an inventory slot and returns them in a new stack.- Specified by:
decrStackSize
in interfaceIInventory
-
removeStackFromSlot
public ItemStack removeStackFromSlot(int i)
+ Removes a stack from the given slot and returns it.- Specified by:
removeStackFromSlot
in interfaceIInventory
-
setInventorySlotContents
public void setInventorySlotContents(int i, ItemStack itemstack)
+ Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).- Specified by:
setInventorySlotContents
in interfaceIInventory
-
getStrVsBlock
public float getStrVsBlock(Block blockIn)
-
writeToNBT
public NBTTagList writeToNBT(NBTTagList parNBTTagList)
+ Writes the inventory out as a list of compound tags. This is where the slot indices are used (+100 for armor, +80 for crafting).
-
readFromNBT
public void readFromNBT(NBTTagList parNBTTagList)
+ Reads from the given tag list and fills the slots in the inventory with the correct items.
-
getSizeInventory
public int getSizeInventory()
+ Returns the number of slots in the inventory.- Specified by:
getSizeInventory
in interfaceIInventory
-
getStackInSlot
public ItemStack getStackInSlot(int i)
+ Returns the stack in the given slot.- Specified by:
getStackInSlot
in interfaceIInventory
-
getName
public java.lang.String getName()
+ Gets the name of this command sender (usually username, but possibly "Rcon")- Specified by:
getName
in interfaceIWorldNameable
-
hasCustomName
public boolean hasCustomName()
+ Returns true if this thing is named- Specified by:
hasCustomName
in interfaceIWorldNameable
-
getDisplayName
public IChatComponent getDisplayName()
+ Get the formatted ChatComponent that will be used for the sender's username in chat- Specified by:
getDisplayName
in interfaceIWorldNameable
-
getInventoryStackLimit
public int getInventoryStackLimit()
+ Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended.- Specified by:
getInventoryStackLimit
in interfaceIInventory
-
canHeldItemHarvest
public boolean canHeldItemHarvest(Block blockIn)
-
armorItemInSlot
public ItemStack armorItemInSlot(int parInt1)
+ returns a player armor item (as itemstack) contained in specified armor slot.
-
getTotalArmorValue
public int getTotalArmorValue()
+ Based on the damage values and maximum damage values of each armor item, returns the current armor value.
-
damageArmor
public void damageArmor(float damage)
+ Damages armor in each slot by the specified amount.
-
dropAllItems
public void dropAllItems()
+ Drop all armor and main inventory items.
-
markDirty
public void markDirty()
+ For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think it hasn't changed and skip it.- Specified by:
markDirty
in interfaceIInventory
-
setItemStack
public void setItemStack(ItemStack itemStackIn)
+ Set the stack helds by mouse, used in GUI/Container
-
getItemStack
public ItemStack getItemStack()
+ Stack helds by mouse, used in GUI and Containers
-
isUseableByPlayer
public boolean isUseableByPlayer(EntityPlayer entityplayer)
+ Do not make give this method the name canInteractWith because it clashes with Container- Specified by:
isUseableByPlayer
in interfaceIInventory
-
hasItemStack
public boolean hasItemStack(ItemStack itemStackIn)
+ Returns true if the specified ItemStack exists in the inventory.
-
openInventory
public void openInventory(EntityPlayer var1)
- Specified by:
openInventory
in interfaceIInventory
-
closeInventory
public void closeInventory(EntityPlayer var1)
- Specified by:
closeInventory
in interfaceIInventory
-
isItemValidForSlot
public boolean isItemValidForSlot(int var1, ItemStack var2)
+ Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.- Specified by:
isItemValidForSlot
in interfaceIInventory
-
copyInventory
public void copyInventory(InventoryPlayer playerInventory)
+ Copy the ItemStack contents from another InventoryPlayer instance
-
getField
public int getField(int var1)
- Specified by:
getField
in interfaceIInventory
-
setField
public void setField(int var1, int var2)
- Specified by:
setField
in interfaceIInventory
-
getFieldCount
public int getFieldCount()
- Specified by:
getFieldCount
in interfaceIInventory
-
clear
public void clear()
- Specified by:
clear
in interfaceIInventory
-
-