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.intcurrentItembooleaninventoryChangedItemStack[]mainInventory+ An array of 36 item stacks indicating the main player inventory (including the visible bar).EntityPlayerplayer
-
Constructor Summary
Constructors Constructor Description InventoryPlayer(EntityPlayer playerIn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddItemStackToInventory(ItemStack itemStackIn)+ Adds the item stack to the inventory, returns false if it is impossible.ItemStackarmorItemInSlot(int parInt1)+ returns a player armor item (as itemstack) contained in specified armor slot.booleancanHeldItemHarvest(Block blockIn)voidchangeCurrentItem(int parInt1)+ Switch the current item to the next one or the previous onevoidclear()intclearMatchingItems(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.voidcloseInventory(EntityPlayer var1)booleanconsumeInventoryItem(Item itemIn)+ removed one item of specified Item from inventory (if it is in a stack, the stack size will reduce with 1)voidcopyInventory(InventoryPlayer playerInventory)+ Copy the ItemStack contents from another InventoryPlayer instancevoiddamageArmor(float damage)+ Damages armor in each slot by the specified amount.voiddecrementAnimations()+ Decrement the number of animations remaining.ItemStackdecrStackSize(int i, int j)+ Removes up to a specified number of items from an inventory slot and returns them in a new stack.voiddropAllItems()+ Drop all armor and main inventory items.ItemStackgetCurrentItem()+ Returns the item stack currently held by the player.IChatComponentgetDisplayName()+ Get the formatted ChatComponent that will be used for the sender's username in chatintgetField(int var1)intgetFieldCount()intgetFirstEmptyStack()+ Returns the first item stack that is empty.static intgetHotbarSize()+ Get the size of the player hotbar inventoryintgetInventoryStackLimit()+ Returns the maximum stack size for a inventory slot.ItemStackgetItemStack()+ Stack helds by mouse, used in GUI and Containersjava.lang.StringgetName()+ Gets the name of this command sender (usually username, but possibly "Rcon")intgetSizeInventory()+ Returns the number of slots in the inventory.ItemStackgetStackInSlot(int i)+ Returns the stack in the given slot.floatgetStrVsBlock(Block blockIn)intgetTotalArmorValue()+ Based on the damage values and maximum damage values of each armor item, returns the current armor value.booleanhasCustomName()+ Returns true if this thing is namedbooleanhasItem(Item itemIn)+ Checks if a specified Item is inside the inventorybooleanhasItemStack(ItemStack itemStackIn)+ Returns true if the specified ItemStack exists in the inventory.booleanisItemValidForSlot(int var1, ItemStack var2)+ Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.booleanisUseableByPlayer(EntityPlayer entityplayer)+ Do not make give this method the name canInteractWith because it clashes with ContainervoidloadPluginData(BaseData data)PluginDatamakePluginData()voidmarkDirty()+ 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.voidopenInventory(EntityPlayer var1)voidreadFromNBT(NBTTagList parNBTTagList)+ Reads from the given tag list and fills the slots in the inventory with the correct items.ItemStackremoveStackFromSlot(int i)+ Removes a stack from the given slot and returns it.voidsetCurrentItem(Item itemIn, int parInt1, boolean parFlag, boolean parFlag2)voidsetField(int var1, int var2)voidsetInventorySlotContents(int i, ItemStack itemstack)+ Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).voidsetItemStack(ItemStack itemStackIn)+ Set the stack helds by mouse, used in GUI/ContainerNBTTagListwriteToNBT(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:
decrStackSizein interfaceIInventory
-
removeStackFromSlot
public ItemStack removeStackFromSlot(int i)
+ Removes a stack from the given slot and returns it.- Specified by:
removeStackFromSlotin 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:
setInventorySlotContentsin 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:
getSizeInventoryin interfaceIInventory
-
getStackInSlot
public ItemStack getStackInSlot(int i)
+ Returns the stack in the given slot.- Specified by:
getStackInSlotin interfaceIInventory
-
getName
public java.lang.String getName()
+ Gets the name of this command sender (usually username, but possibly "Rcon")- Specified by:
getNamein interfaceIWorldNameable
-
hasCustomName
public boolean hasCustomName()
+ Returns true if this thing is named- Specified by:
hasCustomNamein interfaceIWorldNameable
-
getDisplayName
public IChatComponent getDisplayName()
+ Get the formatted ChatComponent that will be used for the sender's username in chat- Specified by:
getDisplayNamein 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:
getInventoryStackLimitin 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:
markDirtyin 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:
isUseableByPlayerin 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:
openInventoryin interfaceIInventory
-
closeInventory
public void closeInventory(EntityPlayer var1)
- Specified by:
closeInventoryin 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:
isItemValidForSlotin interfaceIInventory
-
copyInventory
public void copyInventory(InventoryPlayer playerInventory)
+ Copy the ItemStack contents from another InventoryPlayer instance
-
getField
public int getField(int var1)
- Specified by:
getFieldin interfaceIInventory
-
setField
public void setField(int var1, int var2)- Specified by:
setFieldin interfaceIInventory
-
getFieldCount
public int getFieldCount()
- Specified by:
getFieldCountin interfaceIInventory
-
clear
public void clear()
- Specified by:
clearin interfaceIInventory
-
-