public class HopperTileEntity extends LockableLootTileEntity implements IHopper, ITickableTileEntity
| Modifier and Type | Field and Description |
|---|---|
private NonNullList<ItemStack> |
inventory |
private long |
tickedGameTime |
private int |
transferCooldown |
lootTable, lootTableSeedpos, removed, worldBLOCK_ABOVE_SHAPE, COLLECTION_AREA_SHAPE, INSIDE_BOWL_SHAPEINFINITE_EXTENT_AABB| Constructor and Description |
|---|
HopperTileEntity() |
| Modifier and Type | Method and Description |
|---|---|
private static boolean |
canCombine(ItemStack stack1,
ItemStack stack2) |
private static boolean |
canExtractItemFromSlot(IInventory inventoryIn,
ItemStack stack,
int index,
Direction side) |
private static boolean |
canInsertItemInSlot(IInventory inventoryIn,
ItemStack stack,
int index,
Direction side) |
static boolean |
captureItem(IInventory p_200114_0_,
ItemEntity p_200114_1_) |
protected Container |
createMenu(int id,
PlayerInventory player) |
protected IItemHandler |
createUnSidedHandler() |
ItemStack |
decrStackSize(int index,
int count) |
private static java.util.stream.IntStream |
func_213972_a(IInventory p_213972_0_,
Direction p_213972_1_) |
static java.util.List<ItemEntity> |
getCaptureItems(IHopper p_200115_0_) |
protected ITextComponent |
getDefaultName() |
static IInventory |
getInventoryAtPosition(World p_195484_0_,
BlockPos p_195484_1_) |
static IInventory |
getInventoryAtPosition(World worldIn,
double x,
double y,
double z) |
private IInventory |
getInventoryForHopperTransfer() |
protected NonNullList<ItemStack> |
getItems() |
long |
getLastUpdateTime() |
int |
getSizeInventory() |
static IInventory |
getSourceInventory(IHopper hopper) |
double |
getXPos() |
double |
getYPos() |
double |
getZPos() |
private static ItemStack |
insertStack(IInventory source,
IInventory destination,
ItemStack stack,
int index,
Direction direction) |
private boolean |
isFull() |
private static boolean |
isInventoryEmpty(IInventory inventoryIn,
Direction side) |
private boolean |
isInventoryFull(IInventory inventoryIn,
Direction side) |
private boolean |
isOnTransferCooldown() |
boolean |
mayTransfer() |
void |
onEntityCollision(Entity p_200113_1_) |
private static boolean |
pullItemFromSlot(IHopper hopper,
IInventory inventoryIn,
int index,
Direction direction) |
static boolean |
pullItems(IHopper hopper) |
static ItemStack |
putStackInInventoryAllSlots(IInventory source,
IInventory destination,
ItemStack stack,
Direction direction) |
void |
read(CompoundNBT compound) |
void |
setInventorySlotContents(int index,
ItemStack stack) |
protected void |
setItems(NonNullList<ItemStack> itemsIn) |
void |
setTransferCooldown(int ticks) |
void |
tick() |
private boolean |
transferItemsOut() |
private boolean |
updateHopper(java.util.function.Supplier<java.lang.Boolean> p_200109_1_) |
CompoundNBT |
write(CompoundNBT compound) |
canOpen, checkLootAndRead, checkLootAndWrite, clear, createMenu, fillWithLoot, getStackInSlot, isEmpty, isUsableByPlayer, removeStackFromSlot, setLootTable, setLootTablecanUnlock, getCapability, getCustomName, getDisplayName, getName, remove, setCustomNameaddInfoToCrashReport, create, getBlockState, getDistanceSq, getMaxRenderDistanceSquared, getPos, getTileData, getType, getUpdatePacket, getUpdateTag, getWorld, hasWorld, isRemoved, markDirty, mirror, onlyOpsCanSetNbt, receiveClientEvent, rotate, setPos, setWorldAndPos, updateContainingBlockInfo, validate, warnInvalidBlockareCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, getCapabilities, invalidateCaps, reviveCaps, serializeCapsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCollectionArea, getWorldcloseInventory, count, getInventoryStackLimit, getStackInSlot, hasAny, isEmpty, isItemValidForSlot, isUsableByPlayer, markDirty, openInventory, removeStackFromSlotclear, clearObjhasCustomNamecanRenderBreaking, deserializeNBT, getModelData, getRenderBoundingBox, getTileEntity, handleUpdateTag, hasFastRenderer, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate, serializeNBTgetCapabilityprivate NonNullList<ItemStack> inventory
private int transferCooldown
private long tickedGameTime
public void read(CompoundNBT compound)
read in class LockableTileEntitypublic CompoundNBT write(CompoundNBT compound)
write in class LockableTileEntitypublic int getSizeInventory()
getSizeInventory in interface IInventorypublic ItemStack decrStackSize(int index, int count)
decrStackSize in interface IInventorydecrStackSize in class LockableLootTileEntitypublic void setInventorySlotContents(int index,
ItemStack stack)
setInventorySlotContents in interface IInventorysetInventorySlotContents in class LockableLootTileEntityprotected ITextComponent getDefaultName()
getDefaultName in class LockableTileEntitypublic void tick()
tick in interface ITickableTileEntityprivate boolean updateHopper(java.util.function.Supplier<java.lang.Boolean> p_200109_1_)
private boolean isFull()
private boolean transferItemsOut()
private static java.util.stream.IntStream func_213972_a(IInventory p_213972_0_, Direction p_213972_1_)
private boolean isInventoryFull(IInventory inventoryIn, Direction side)
private static boolean isInventoryEmpty(IInventory inventoryIn, Direction side)
public static boolean pullItems(IHopper hopper)
private static boolean pullItemFromSlot(IHopper hopper, IInventory inventoryIn, int index, Direction direction)
public static boolean captureItem(IInventory p_200114_0_, ItemEntity p_200114_1_)
public static ItemStack putStackInInventoryAllSlots(@Nullable IInventory source, IInventory destination, ItemStack stack, @Nullable Direction direction)
private static boolean canInsertItemInSlot(IInventory inventoryIn, ItemStack stack, int index, @Nullable Direction side)
private static boolean canExtractItemFromSlot(IInventory inventoryIn, ItemStack stack, int index, Direction side)
private static ItemStack insertStack(@Nullable IInventory source, IInventory destination, ItemStack stack, int index, @Nullable Direction direction)
@Nullable private IInventory getInventoryForHopperTransfer()
@Nullable public static IInventory getSourceInventory(IHopper hopper)
public static java.util.List<ItemEntity> getCaptureItems(IHopper p_200115_0_)
@Nullable public static IInventory getInventoryAtPosition(World p_195484_0_, BlockPos p_195484_1_)
@Nullable public static IInventory getInventoryAtPosition(World worldIn, double x, double y, double z)
public void setTransferCooldown(int ticks)
private boolean isOnTransferCooldown()
public boolean mayTransfer()
protected NonNullList<ItemStack> getItems()
getItems in class LockableLootTileEntityprotected void setItems(NonNullList<ItemStack> itemsIn)
setItems in class LockableLootTileEntitypublic void onEntityCollision(Entity p_200113_1_)
protected Container createMenu(int id, PlayerInventory player)
createMenu in class LockableTileEntityprotected IItemHandler createUnSidedHandler()
createUnSidedHandler in class LockableTileEntitypublic long getLastUpdateTime()