Package net.minecraft.src
Class TileEntityChest
java.lang.Object
net.minecraft.src.TileEntity
net.minecraft.src.TileEntityChest
- All Implemented Interfaces:
IInventory
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanDetermines if the check for adjacent chests has taken place.Contains the chest tile located adjacent to this one (if any)Contains the chest tile located adjacent to this one (if any)Contains the chest tile located adjacent to this one (if any)Contains the chest tile located adjacent to this one (if any)floatThe current angle of the lid (between 0 and 1)intThe number of players currently using this chestfloatThe angle of the lid last tickFields inherited from class net.minecraft.src.TileEntity
blockMetadata, blockType, tileEntityInvalid, worldObj, xCoord, yCoord, zCoord -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidPerforms the check for adjacent chests to determine if this chest is double or not.voidvoiddecrStackSize(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.intintReturns the maximum stack size for a inventory slot.Returns the name of the inventory.intReturns the number of slots in the inventory.getStackInSlot(int par1) Returns the stack in slot igetStackInSlotOnClosing(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.voidinvalidates a tile entityprotected booleanisAdjacentChest(int blockID, int i, int j, int k) booleanIf this returns false, the inventory name will be used as an unlocalized name, and translated into the player's language.booleanisItemValidForSlot(int par1, ItemStack par2ItemStack) Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.booleanisUseableByPlayer(EntityPlayer par1EntityPlayer) Do not make give this method the name canInteractWith because it clashes with ContainervoidvoidreadFromNBT(NBTTagCompound par1NBTTagCompound) Reads a tile entity from NBT.booleanreceiveClientEvent(int par1, int par2) Called when a client event is received with the event number and argument, see World.sendClientEventvoidsetChestGuiName(String par1Str) Sets the custom display name to use when opening a GUI for this specific TileEntityChest.voidsetInventorySlotContents(int par1, ItemStack par2ItemStack) Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).voidCauses the TileEntity to reset all it's cached values for it's container block, blockID, metaData and in the case of chests, the adjcacent chest checkvoidAllows the entity to update its state.protected voidvalidateNeighborConnection(TileEntityChest neighborEntity, int direction) voidwriteToNBT(NBTTagCompound par1NBTTagCompound) Writes a tile entity to NBT.Methods inherited from class net.minecraft.src.TileEntity
addMapping, createAndLoadEntity, func_85027_a, getBlockMetadata, getBlockType, getDescriptionPacket, getDistanceFrom, getMaxRenderDistanceSquared, getWorldObj, hasWorldObj, isInvalid, onInventoryChanged, setWorldObj, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.src.IInventory
onInventoryChanged
-
Field Details
-
adjacentChestChecked
public boolean adjacentChestCheckedDetermines if the check for adjacent chests has taken place. -
adjacentChestZNeg
Contains the chest tile located adjacent to this one (if any) -
adjacentChestXPos
Contains the chest tile located adjacent to this one (if any) -
adjacentChestXNeg
Contains the chest tile located adjacent to this one (if any) -
adjacentChestZPosition
Contains the chest tile located adjacent to this one (if any) -
lidAngle
public float lidAngleThe current angle of the lid (between 0 and 1) -
prevLidAngle
public float prevLidAngleThe angle of the lid last tick -
numUsingPlayers
public int numUsingPlayersThe number of players currently using this chest
-
-
Constructor Details
-
TileEntityChest
public TileEntityChest() -
TileEntityChest
public TileEntityChest(int par1)
-
-
Method Details
-
getSizeInventory
public int getSizeInventory()Returns the number of slots in the inventory.- Specified by:
getSizeInventoryin interfaceIInventory
-
getStackInSlot
Returns the stack in slot i- Specified by:
getStackInSlotin interfaceIInventory
-
decrStackSize
Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new stack.- Specified by:
decrStackSizein interfaceIInventory
-
getStackInSlotOnClosing
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.- Specified by:
getStackInSlotOnClosingin interfaceIInventory
-
setInventorySlotContents
Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).- Specified by:
setInventorySlotContentsin interfaceIInventory
-
getInvName
Returns the name of the inventory.- Specified by:
getInvNamein interfaceIInventory
-
isInvNameLocalized
public boolean 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.- Specified by:
isInvNameLocalizedin interfaceIInventory
-
setChestGuiName
Sets the custom display name to use when opening a GUI for this specific TileEntityChest. -
readFromNBT
Reads a tile entity from NBT.- Overrides:
readFromNBTin classTileEntity
-
writeToNBT
Writes a tile entity to NBT.- Overrides:
writeToNBTin classTileEntity
-
getInventoryStackLimit
public int 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?*- Specified by:
getInventoryStackLimitin interfaceIInventory
-
isUseableByPlayer
Do not make give this method the name canInteractWith because it clashes with Container- Specified by:
isUseableByPlayerin interfaceIInventory
-
updateContainingBlockInfo
public void updateContainingBlockInfo()Causes the TileEntity to reset all it's cached values for it's container block, blockID, metaData and in the case of chests, the adjcacent chest check- Overrides:
updateContainingBlockInfoin classTileEntity
-
checkForAdjacentChests
public void checkForAdjacentChests()Performs the check for adjacent chests to determine if this chest is double or not. -
updateEntity
public void updateEntity()Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count ticks and creates a new spawn inside its implementation.- Overrides:
updateEntityin classTileEntity
-
receiveClientEvent
public boolean receiveClientEvent(int par1, int par2) Called when a client event is received with the event number and argument, see World.sendClientEvent- Overrides:
receiveClientEventin classTileEntity
-
openChest
public void openChest()- Specified by:
openChestin interfaceIInventory
-
closeChest
public void closeChest()- Specified by:
closeChestin interfaceIInventory
-
isItemValidForSlot
Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.- Specified by:
isItemValidForSlotin interfaceIInventory
-
invalidate
public void invalidate()invalidates a tile entity- Overrides:
invalidatein classTileEntity
-
getChestType
public int getChestType() -
isAdjacentChest
protected boolean isAdjacentChest(int blockID, int i, int j, int k) -
validateNeighborConnection
-
clearContents
public void clearContents()
-