Package net.minecraft.tileentity
Class TileEntityHopper
- java.lang.Object
-
- net.minecraft.tileentity.TileEntity
-
- net.minecraft.tileentity.TileEntityLockable
-
- net.minecraft.tileentity.TileEntityHopper
-
- All Implemented Interfaces:
IInventory
,IHopper
,ITickable
,IInteractionObject
,ILockableContainer
,IWorldNameable
public class TileEntityHopper extends TileEntityLockable implements IHopper, ITickable
+ 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)
-
-
Field Summary
-
Fields inherited from class net.minecraft.tileentity.TileEntity
blockType, pos, tileEntityInvalid, worldObj
-
-
Constructor Summary
Constructors Constructor Description TileEntityHopper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
captureDroppedItems(IHopper parIHopper)
void
clear()
void
closeInventory(EntityPlayer var1)
Container
createContainer(InventoryPlayer inventoryplayer, EntityPlayer entityplayer)
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.static java.util.List<EntityItem>
func_181556_a(World parWorld, double parDouble1, double parDouble2, double parDouble3)
int
getField(int var1)
int
getFieldCount()
java.lang.String
getGuiID()
static IInventory
getHopperInventory(IHopper hopper)
+ Returns the IInventory for the specified hopperstatic IInventory
getInventoryAtPosition(World worldIn, double x, double y, double z)
+ Returns the IInventory (if applicable) of the TileEntity at the specified positionint
getInventoryStackLimit()
+ Returns the maximum stack size for a inventory slot.java.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.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 namedboolean
isItemValidForSlot(int var1, ItemStack var2)
+ Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.boolean
isOnTransferCooldown()
boolean
isUseableByPlayer(EntityPlayer entityplayer)
+ Do not make give this method the name canInteractWith because it clashes with Containervoid
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 var1)
static boolean
putDropInInventoryAllSlots(IInventory itemIn, EntityItem parEntityItem)
+ 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 nbttagcompound)
ItemStack
removeStackFromSlot(int i)
+ Removes a stack from the given slot and returns it.void
setCustomName(java.lang.String customNameIn)
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
setTransferCooldown(int ticks)
void
update()
+ Like the old updateEntity(), except more generic.boolean
updateHopper()
void
writeToNBT(NBTTagCompound nbttagcompound)
-
Methods inherited from class net.minecraft.tileentity.TileEntityLockable
getDisplayName, getLockCode, isLocked, setLockCode
-
Methods inherited from class net.minecraft.tileentity.TileEntity
addInfoToCrashReport, createAndLoadEntity, func_183000_F, getBlockMetadata, getBlockType, getDescriptionPacket, getDistanceSq, getMaxRenderDistanceSquared, getPos, getWorld, hasWorldObj, invalidate, isInvalid, receiveClientEvent, setPos, setWorldObj, updateContainingBlockInfo, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.minecraft.world.IWorldNameable
getDisplayName
-
-
-
-
Method Detail
-
readFromNBT
public void readFromNBT(NBTTagCompound nbttagcompound)
- Overrides:
readFromNBT
in classTileEntityLockable
-
writeToNBT
public void writeToNBT(NBTTagCompound nbttagcompound)
- Overrides:
writeToNBT
in classTileEntityLockable
-
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
- Overrides:
markDirty
in classTileEntity
-
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
-
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
-
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
-
setCustomName
public void setCustomName(java.lang.String customNameIn)
-
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
-
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
-
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
-
update
public void update()
+ Like the old updateEntity(), except more generic.
-
updateHopper
public boolean updateHopper()
-
captureDroppedItems
public static boolean captureDroppedItems(IHopper parIHopper)
-
putDropInInventoryAllSlots
public static boolean putDropInInventoryAllSlots(IInventory itemIn, EntityItem parEntityItem)
+ Attempts to place the passed EntityItem's stack into the inventory using as many slots as possible. Returns false if the stackSize of the drop was not depleted.
-
putStackInInventoryAllSlots
public static ItemStack putStackInInventoryAllSlots(IInventory inventoryIn, ItemStack stack, EnumFacing side)
+ Attempts to place the passed stack in the inventory, using as many slots as required. Returns leftover items
-
getHopperInventory
public static IInventory getHopperInventory(IHopper hopper)
+ Returns the IInventory for the specified hopper
-
func_181556_a
public static java.util.List<EntityItem> func_181556_a(World parWorld, double parDouble1, double parDouble2, double parDouble3)
-
getInventoryAtPosition
public static IInventory getInventoryAtPosition(World worldIn, double x, double y, double z)
+ Returns the IInventory (if applicable) of the TileEntity at the specified position
-
getXPos
public double getXPos()
+ Gets the world X position for this hopper entity.
-
getYPos
public double getYPos()
+ Gets the world Y position for this hopper entity.
-
getZPos
public double getZPos()
+ Gets the world Z position for this hopper entity.
-
setTransferCooldown
public void setTransferCooldown(int ticks)
-
isOnTransferCooldown
public boolean isOnTransferCooldown()
-
mayTransfer
public boolean mayTransfer()
-
getGuiID
public java.lang.String getGuiID()
- Specified by:
getGuiID
in interfaceIInteractionObject
-
createContainer
public Container createContainer(InventoryPlayer inventoryplayer, EntityPlayer entityplayer)
- Specified by:
createContainer
in interfaceIInteractionObject
-
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
-
-