public class TileEntityHopper extends TileEntityLockable implements IHopper, ITickable
blockType, INFINITE_EXTENT_AABB, pos, tileEntityInvalid, worldObj
Constructor and Description |
---|
TileEntityHopper() |
Modifier and Type | Method and Description |
---|---|
static boolean |
captureDroppedItems(IHopper p_145891_0_) |
void |
clear() |
void |
closeInventory(EntityPlayer player) |
Container |
createContainer(InventoryPlayer playerInventory,
EntityPlayer playerIn) |
protected IItemHandler |
createUnSidedHandler() |
ItemStack |
decrStackSize(int index,
int count)
Removes up to a specified number of items from an inventory slot and returns them in a new stack.
|
static java.util.List<EntityItem> |
func_181556_a(World p_181556_0_,
double p_181556_1_,
double p_181556_3_,
double p_181556_5_) |
int |
getField(int id) |
int |
getFieldCount() |
java.lang.String |
getGuiID() |
static IInventory |
getHopperInventory(IHopper hopper)
Returns the IInventory for the specified hopper
|
static IInventory |
getInventoryAtPosition(World worldIn,
double x,
double y,
double z)
Returns the IInventory (if applicable) of the TileEntity at the specified position
|
int |
getInventoryStackLimit()
Returns the maximum stack size for a inventory slot.
|
java.lang.String |
getName()
Get the name of this object.
|
int |
getSizeInventory()
Returns the number of slots in the inventory.
|
ItemStack |
getStackInSlot(int index)
Returns the stack in the given slot.
|
double |
getXPos()
Gets the world X position for this hopper entity.
|
double |
getYPos()
Gets the world Y position for this hopper entity.
|
double |
getZPos()
Gets the world Z position for this hopper entity.
|
boolean |
hasCustomName()
Returns true if this thing is named
|
boolean |
isItemValidForSlot(int index,
ItemStack stack)
Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
|
boolean |
isOnTransferCooldown() |
boolean |
isUseableByPlayer(EntityPlayer player)
Do not make give this method the name canInteractWith because it clashes with Container
|
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.
|
boolean |
mayTransfer() |
void |
openInventory(EntityPlayer player) |
static boolean |
putDropInInventoryAllSlots(IInventory p_145898_0_,
EntityItem itemIn)
Attempts to place the passed EntityItem's stack into the inventory using as many slots as possible.
|
static ItemStack |
putStackInInventoryAllSlots(IInventory inventoryIn,
ItemStack stack,
EnumFacing side)
Attempts to place the passed stack in the inventory, using as many slots as required.
|
void |
readFromNBT(NBTTagCompound compound) |
ItemStack |
removeStackFromSlot(int index)
Removes a stack from the given slot and returns it.
|
void |
setCustomName(java.lang.String customNameIn) |
void |
setField(int id,
int value) |
void |
setInventorySlotContents(int index,
ItemStack stack)
Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
|
void |
setTransferCooldown(int ticks) |
void |
update()
Like the old updateEntity(), except more generic.
|
boolean |
updateHopper() |
void |
writeToNBT(NBTTagCompound compound) |
getCapability, getDisplayName, getLockCode, hasCapability, isLocked, setLockCode
addInfoToCrashReport, addMapping, canRenderBreaking, createAndLoadEntity, deserializeNBT, func_183000_F, getBlockMetadata, getBlockType, getDescriptionPacket, getDistanceSq, getMaxRenderDistanceSquared, getPos, getRenderBoundingBox, getTileData, getWorld, hasFastRenderer, hasWorldObj, invalidate, isInvalid, onChunkUnload, onDataPacket, onLoad, receiveClientEvent, restrictNBTCopy, serializeNBT, setPos, setWorldObj, shouldRefresh, shouldRenderInPass, updateContainingBlockInfo, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDisplayName
public void readFromNBT(NBTTagCompound compound)
readFromNBT
in class TileEntityLockable
public void writeToNBT(NBTTagCompound compound)
writeToNBT
in class TileEntityLockable
public void markDirty()
markDirty
in interface IInventory
markDirty
in class TileEntity
public int getSizeInventory()
getSizeInventory
in interface IInventory
public ItemStack getStackInSlot(int index)
getStackInSlot
in interface IInventory
public ItemStack decrStackSize(int index, int count)
decrStackSize
in interface IInventory
public ItemStack removeStackFromSlot(int index)
removeStackFromSlot
in interface IInventory
public void setInventorySlotContents(int index, ItemStack stack)
setInventorySlotContents
in interface IInventory
public java.lang.String getName()
getName
in interface IWorldNameable
public boolean hasCustomName()
hasCustomName
in interface IWorldNameable
public void setCustomName(java.lang.String customNameIn)
public int getInventoryStackLimit()
getInventoryStackLimit
in interface IInventory
public boolean isUseableByPlayer(EntityPlayer player)
isUseableByPlayer
in interface IInventory
public void openInventory(EntityPlayer player)
openInventory
in interface IInventory
public void closeInventory(EntityPlayer player)
closeInventory
in interface IInventory
public boolean isItemValidForSlot(int index, ItemStack stack)
isItemValidForSlot
in interface IInventory
public void update()
public boolean updateHopper()
public static boolean captureDroppedItems(IHopper p_145891_0_)
public static boolean putDropInInventoryAllSlots(IInventory p_145898_0_, EntityItem itemIn)
public static ItemStack putStackInInventoryAllSlots(IInventory inventoryIn, ItemStack stack, EnumFacing side)
public static IInventory getHopperInventory(IHopper hopper)
public static java.util.List<EntityItem> func_181556_a(World p_181556_0_, double p_181556_1_, double p_181556_3_, double p_181556_5_)
public static IInventory getInventoryAtPosition(World worldIn, double x, double y, double z)
public double getXPos()
public double getYPos()
public double getZPos()
public void setTransferCooldown(int ticks)
public boolean isOnTransferCooldown()
public boolean mayTransfer()
public java.lang.String getGuiID()
getGuiID
in interface IInteractionObject
public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn)
createContainer
in interface IInteractionObject
public int getField(int id)
getField
in interface IInventory
public void setField(int id, int value)
setField
in interface IInventory
public int getFieldCount()
getFieldCount
in interface IInventory
public void clear()
clear
in interface IInventory
protected IItemHandler createUnSidedHandler()
createUnSidedHandler
in class TileEntityLockable