Package net.minecraft.tileentity
Class HopperTileEntity
- All Implemented Interfaces:
IContainerProvider
,INamedContainerProvider
,IClearable
,IInventory
,IHopper
,ITickableTileEntity
,INameable
,ICapabilityProvider
,ICapabilitySerializable<CompoundNBT>
,IForgeTileEntity
,INBTSerializable<CompoundNBT>
public class HopperTileEntity
extends LockableLootTileEntity
implements IHopper, ITickableTileEntity
-
Field Summary
Fields inherited from class net.minecraft.tileentity.LockableLootTileEntity
lootTable, lootTableSeed
Fields inherited from class net.minecraft.tileentity.TileEntity
level, remove, worldPosition
Fields inherited from interface net.minecraftforge.common.extensions.IForgeTileEntity
INFINITE_EXTENT_AABB
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
addItem
(IInventory p_200114_0_, ItemEntity p_200114_1_) static ItemStack
addItem
(IInventory p_174918_0_, IInventory p_174918_1_, ItemStack p_174918_2_, Direction p_174918_3_) private static boolean
canMergeItems
(ItemStack p_145894_0_, ItemStack p_145894_1_) private static boolean
canPlaceItemInContainer
(IInventory p_174920_0_, ItemStack p_174920_1_, int p_174920_2_, Direction p_174920_3_) private static boolean
canTakeItemFromContainer
(IInventory p_174921_0_, ItemStack p_174921_1_, int p_174921_2_, Direction p_174921_3_) protected Container
createMenu
(int p_213906_1_, PlayerInventory p_213906_2_) protected IItemHandler
private boolean
void
entityInside
(Entity p_200113_1_) private IInventory
static IInventory
getContainerAt
(World p_145893_0_, double p_145893_1_, double p_145893_3_, double p_145893_5_) static IInventory
getContainerAt
(World p_195484_0_, BlockPos p_195484_1_) int
protected ITextComponent
protected NonNullList<ItemStack>
getItems()
static List<ItemEntity>
getItemsAtAndAbove
(IHopper p_200115_0_) long
double
double
double
private static IntStream
getSlots
(IInventory p_213972_0_, Direction p_213972_1_) static IInventory
getSourceContainer
(IHopper p_145884_0_) private boolean
private static boolean
isEmptyContainer
(IInventory p_174917_0_, Direction p_174917_1_) private boolean
isFullContainer
(IInventory p_174919_1_, Direction p_174919_2_) private boolean
boolean
void
load
(BlockState p_230337_1_, CompoundNBT p_230337_2_) removeItem
(int p_70298_1_, int p_70298_2_) save
(CompoundNBT p_189515_1_) void
setCooldown
(int p_145896_1_) void
protected void
setItems
(NonNullList<ItemStack> p_199721_1_) static boolean
suckInItems
(IHopper p_145891_0_) void
tick()
private static ItemStack
tryMoveInItem
(IInventory p_174916_0_, IInventory p_174916_1_, ItemStack p_174916_2_, int p_174916_3_, Direction p_174916_4_) private boolean
tryMoveItems
(Supplier<Boolean> p_200109_1_) private static boolean
tryTakeInItemFromSlot
(IHopper p_174915_0_, IInventory p_174915_1_, int p_174915_2_, Direction p_174915_3_) Methods inherited from class net.minecraft.tileentity.LockableLootTileEntity
canOpen, clearContent, createMenu, getItem, isEmpty, removeItemNoUpdate, setLootTable, setLootTable, stillValid, tryLoadLootTable, trySaveLootTable, unpackLootTable
Methods inherited from class net.minecraft.tileentity.LockableTileEntity
canUnlock, getCapability, getCustomName, getDisplayName, getName, invalidateCaps, setCustomName
Methods inherited from class net.minecraft.tileentity.TileEntity
clearCache, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getTileData, getType, getUpdatePacket, getUpdateTag, getViewDistance, hasLevel, isRemoved, loadStatic, logInvalidState, mirror, onChunkUnloaded, onlyOpCanSetNbt, rotate, setChanged, setLevelAndPosition, setPosition, setRemoved, triggerEvent
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, reviveCaps, serializeCaps
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
Methods inherited from interface net.minecraft.inventory.IClearable
clearContent
Methods inherited from interface net.minecraftforge.common.extensions.IForgeTileEntity
deserializeNBT, deserializeNBT, getModelData, getRenderBoundingBox, getTileEntity, handleUpdateTag, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
Methods inherited from interface net.minecraft.tileentity.IHopper
getLevel, getSuckShape
Methods inherited from interface net.minecraft.inventory.IInventory
canPlaceItem, countItem, getItem, getMaxStackSize, hasAnyOf, isEmpty, removeItemNoUpdate, setChanged, startOpen, stillValid, stopOpen
Methods inherited from interface net.minecraft.util.INameable
hasCustomName
-
Field Details
-
items
-
cooldownTime
private int cooldownTime -
tickedGameTime
private long tickedGameTime
-
-
Constructor Details
-
HopperTileEntity
public HopperTileEntity()
-
-
Method Details
-
load
- Overrides:
load
in classLockableTileEntity
-
save
- Overrides:
save
in classLockableTileEntity
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSize
in interfaceIInventory
-
removeItem
- Specified by:
removeItem
in interfaceIInventory
- Overrides:
removeItem
in classLockableLootTileEntity
-
setItem
- Specified by:
setItem
in interfaceIInventory
- Overrides:
setItem
in classLockableLootTileEntity
-
getDefaultName
- Specified by:
getDefaultName
in classLockableTileEntity
-
tick
public void tick()- Specified by:
tick
in interfaceITickableTileEntity
-
tryMoveItems
-
inventoryFull
private boolean inventoryFull() -
ejectItems
private boolean ejectItems() -
getSlots
-
isFullContainer
-
isEmptyContainer
-
suckInItems
-
tryTakeInItemFromSlot
private static boolean tryTakeInItemFromSlot(IHopper p_174915_0_, IInventory p_174915_1_, int p_174915_2_, Direction p_174915_3_) -
addItem
-
addItem
public static ItemStack addItem(@Nullable IInventory p_174918_0_, IInventory p_174918_1_, ItemStack p_174918_2_, @Nullable Direction p_174918_3_) -
canPlaceItemInContainer
private static boolean canPlaceItemInContainer(IInventory p_174920_0_, ItemStack p_174920_1_, int p_174920_2_, @Nullable Direction p_174920_3_) -
canTakeItemFromContainer
private static boolean canTakeItemFromContainer(IInventory p_174921_0_, ItemStack p_174921_1_, int p_174921_2_, Direction p_174921_3_) -
tryMoveInItem
private static ItemStack tryMoveInItem(@Nullable IInventory p_174916_0_, IInventory p_174916_1_, ItemStack p_174916_2_, int p_174916_3_, @Nullable Direction p_174916_4_) -
getAttachedContainer
-
getSourceContainer
-
getItemsAtAndAbove
-
getContainerAt
-
getContainerAt
@Nullable public static IInventory getContainerAt(World p_145893_0_, double p_145893_1_, double p_145893_3_, double p_145893_5_) -
canMergeItems
-
getLevelX
public double getLevelX() -
getLevelY
public double getLevelY() -
getLevelZ
public double getLevelZ() -
setCooldown
public void setCooldown(int p_145896_1_) -
isOnCooldown
private boolean isOnCooldown() -
isOnCustomCooldown
public boolean isOnCustomCooldown() -
getItems
- Specified by:
getItems
in classLockableLootTileEntity
-
setItems
- Specified by:
setItems
in classLockableLootTileEntity
-
entityInside
-
createMenu
- Specified by:
createMenu
in classLockableTileEntity
-
createUnSidedHandler
- Overrides:
createUnSidedHandler
in classLockableTileEntity
-
getLastUpdateTime
public long getLastUpdateTime()
-