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, lootTableSeed
pos, removed, world
BLOCK_ABOVE_SHAPE, COLLECTION_AREA_SHAPE, INSIDE_BOWL_SHAPE
INFINITE_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, setLootTable
canUnlock, getCapability, getCustomName, getDisplayName, getName, remove, setCustomName
addInfoToCrashReport, create, getBlockState, getDistanceSq, getMaxRenderDistanceSquared, getPos, getTileData, getType, getUpdatePacket, getUpdateTag, getWorld, hasWorld, isRemoved, markDirty, mirror, onlyOpsCanSetNbt, receiveClientEvent, rotate, setPos, setWorldAndPos, updateContainingBlockInfo, validate, warnInvalidBlock
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, getCapabilities, invalidateCaps, reviveCaps, serializeCaps
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCollectionArea, getWorld
closeInventory, count, getInventoryStackLimit, getStackInSlot, hasAny, isEmpty, isItemValidForSlot, isUsableByPlayer, markDirty, openInventory, removeStackFromSlot
clear, clearObj
hasCustomName
canRenderBreaking, deserializeNBT, getModelData, getRenderBoundingBox, getTileEntity, handleUpdateTag, hasFastRenderer, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
getCapability
private NonNullList<ItemStack> inventory
private int transferCooldown
private long tickedGameTime
public void read(CompoundNBT compound)
read
in class LockableTileEntity
public CompoundNBT write(CompoundNBT compound)
write
in class LockableTileEntity
public int getSizeInventory()
getSizeInventory
in interface IInventory
public ItemStack decrStackSize(int index, int count)
decrStackSize
in interface IInventory
decrStackSize
in class LockableLootTileEntity
public void setInventorySlotContents(int index, ItemStack stack)
setInventorySlotContents
in interface IInventory
setInventorySlotContents
in class LockableLootTileEntity
protected ITextComponent getDefaultName()
getDefaultName
in class LockableTileEntity
public void tick()
tick
in interface ITickableTileEntity
private 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 LockableLootTileEntity
protected void setItems(NonNullList<ItemStack> itemsIn)
setItems
in class LockableLootTileEntity
public void onEntityCollision(Entity p_200113_1_)
protected Container createMenu(int id, PlayerInventory player)
createMenu
in class LockableTileEntity
protected IItemHandler createUnSidedHandler()
createUnSidedHandler
in class LockableTileEntity
public long getLastUpdateTime()