net.minecraft.block.entity

public class HopperBlockEntity

extends LootableContainerBlockEntity implements Hopper

All mapped superinterfaces:

DebugTrackable, Inventory, Clearable, StackReferenceGetter, NamedScreenHandlerFactory, ScreenHandlerFactory, Nameable, LootableInventory, Hopper

net.minecraft.world.level.block.entity.HopperBlockEntity
net.minecraft.class_2614
net.minecraft.block.entity.HopperBlockEntity

Field summary

Modifier and TypeField
public static final int
MOVE_ITEM_SPEED
field_31341
TRANSFER_COOLDOWN
public static final int
HOPPER_CONTAINER_SIZE
field_31342
INVENTORY_SIZE
private static final int[][]
CACHED_SLOTS
field_49100
AVAILABLE_SLOTS_CACHE
private static final int
NO_COOLDOWN_TIME
field_57778
DEFAULT_TRANSFER_COOLDOWN
private static final Text
DEFAULT_NAME
field_63045
CONTAINER_NAME_TEXT
private DefaultedList<ItemStack>
items
field_12024
inventory
private int
cooldownTime
field_12023
transferCooldown
private long
tickedGameTime
field_12022
lastTickTime
private Direction
facing
field_49101
facing

Constructor summary

ModifierConstructor
public (BlockPos pos, BlockState state)

Method summary

Modifier and TypeMethod
protected void
loadAdditional(ValueInput input)
method_11014(class_11368 arg0)
readData(ReadView arg0)
protected void
saveAdditional(ValueOutput output)
method_11007(class_11372 arg0)
writeData(WriteView arg0)
public int
getContainerSize()
method_5439()
size()
public ItemStack
removeItem(int slot, int count)
method_5434(int arg0, int arg1)
removeStack(int arg0, int arg1)
public void
setItem(int slot, ItemStack itemStack)
method_5447(int arg0, class_1799 arg1)
setStack(int arg0, ItemStack arg1)
public void
setBlockState(BlockState blockState)
method_31664(class_2680 arg0)
setCachedState(BlockState arg0)
protected Text
getDefaultName()
method_17823()
getContainerName()
public static void
pushItemsTick(Level level, BlockPos pos, BlockState state, HopperBlockEntity entity)
method_31692(class_1937 arg0, class_2338 arg1, class_2680 arg2, class_2614 arg3)
serverTick(World world, BlockPos pos, BlockState state, HopperBlockEntity blockEntity)
private static boolean
tryMoveItems(Level level, BlockPos pos, BlockState state, HopperBlockEntity entity, BooleanSupplier action)
method_11243(class_1937 arg0, class_2338 arg1, class_2680 arg2, class_2614 arg3, BooleanSupplier arg4)
insertAndExtract(World world, BlockPos pos, BlockState state, HopperBlockEntity blockEntity, BooleanSupplier arg4)
private boolean
inventoryFull()
method_11256()
isFull()
private static boolean
ejectItems(Level level, BlockPos blockPos, HopperBlockEntity self)
method_11246(class_1937 arg0, class_2338 arg1, class_2614 arg2)
insert(World world, BlockPos pos, HopperBlockEntity blockEntity)
private static int[]
getSlots(Container container, Direction direction)
method_17767(class_1263 arg0, class_2350 arg1)
getAvailableSlots(Inventory inventory, Direction side)
private static int[]
createFlatSlots(int containerSize)
method_57011(int arg0)
indexArray(int size)
private static boolean
isFullContainer(Container container, Direction direction)
method_11258(class_1263 arg0, class_2350 arg1)
isInventoryFull(Inventory inventory, Direction direction)
public static boolean
suckInItems(Level level, Hopper hopper)
method_11241(class_1937 arg0, class_2615 arg1)
extract(World world, Hopper hopper)
private static boolean
tryTakeInItemFromSlot(Hopper hopper, Container container, int slot, Direction direction)
method_11261(class_2615 arg0, class_1263 arg1, int arg2, class_2350 arg3)
extract(Hopper hopper, Inventory inventory, int slot, Direction side)
public static boolean
addItem(Container container, ItemEntity entity)
method_11247(class_1263 arg0, class_1542 arg1)
extract(Inventory inventory, ItemEntity itemEntity)
public static ItemStack
addItem(Container from, Container container, ItemStack itemStack, Direction direction)
method_11260(class_1263 arg0, class_1263 arg1, class_1799 arg2, class_2350 arg3)
transfer(Inventory from, Inventory to, ItemStack stack, Direction side)
private static boolean
canPlaceItemInContainer(Container container, ItemStack itemStack, int slot, Direction direction)
method_11244(class_1263 arg0, class_1799 arg1, int arg2, class_2350 arg3)
canInsert(Inventory inventory, ItemStack stack, int slot, Direction side)
private static boolean
canTakeItemFromContainer(Container into, Container from, ItemStack itemStack, int slot, Direction direction)
method_11252(class_1263 arg0, class_1263 arg1, class_1799 arg2, int arg3, class_2350 arg4)
canExtract(Inventory hopperInventory, Inventory fromInventory, ItemStack stack, int slot, Direction facing)
private static ItemStack
tryMoveInItem(Container from, Container container, ItemStack itemStack, int slot, Direction direction)
method_11253(class_1263 arg0, class_1263 arg1, class_1799 arg2, int arg3, class_2350 arg4)
transfer(Inventory from, Inventory to, ItemStack stack, int slot, Direction side)
private static Inventory
getAttachedContainer(Level level, BlockPos blockPos, HopperBlockEntity self)
method_11255(class_1937 arg0, class_2338 arg1, class_2614 arg2)
getOutputInventory(World world, BlockPos pos, HopperBlockEntity blockEntity)
private static Inventory
getSourceContainer(Level level, Hopper hopper, BlockPos pos, BlockState state)
method_11248(class_1937 arg0, class_2615 arg1, class_2338 arg2, class_2680 arg3)
getInputInventory(World world, Hopper hopper, BlockPos pos, BlockState state)
public static List<ItemEntity>
getItemsAtAndAbove(Level level, Hopper hopper)
method_11237(class_1937 arg0, class_2615 arg1)
getInputItemEntities(World world, Hopper hopper)
public static Inventory
getContainerAt(Level level, BlockPos pos)
method_11250(class_1937 arg0, class_2338 arg1)
getInventoryAt(World world, BlockPos pos)
private static Inventory
getContainerAt(Level level, BlockPos pos, BlockState state, double x, double y, double z)
method_11251(class_1937 arg0, class_2338 arg1, class_2680 arg2, double arg3, double arg4, double arg5)
getInventoryAt(World world, BlockPos pos, BlockState state, double x, double y, double z)
private static Inventory
getBlockContainer(Level level, BlockPos pos, BlockState state)
method_57010(class_1937 arg0, class_2338 arg1, class_2680 arg2)
getBlockInventoryAt(World world, BlockPos pos, BlockState state)
private static Inventory
getEntityContainer(Level level, double x, double y, double z)
method_57009(class_1937 arg0, double arg1, double arg2, double arg3)
getEntityInventoryAt(World world, double x, double y, double z)
private static boolean
canMergeItems(ItemStack a, ItemStack b)
method_11254(class_1799 arg0, class_1799 arg1)
canMergeItems(ItemStack first, ItemStack second)
public double
getLevelX()
method_11266()
getHopperX()
public double
getLevelY()
method_11264()
getHopperY()
public double
getLevelZ()
method_11265()
getHopperZ()
public boolean
isGridAligned()
method_57081()
canBlockFromAbove()
private void
setCooldown(int time)
method_11238(int arg0)
setTransferCooldown(int transferCooldown)
private boolean
isOnCooldown()
method_11239()
needsCooldown()
private boolean
isOnCustomCooldown()
method_11242()
isDisabled()
protected DefaultedList<ItemStack>
getItems()
method_11282()
getHeldStacks()
protected void
setItems(NonNullList<ItemStack> items)
method_11281(class_2371<class_1799> arg0)
setHeldStacks(DefaultedList<ItemStack> arg0)
public static void
entityInside(Level level, BlockPos pos, BlockState blockState, Entity entity, HopperBlockEntity hopper)
method_11236(class_1937 arg0, class_2338 arg1, class_2680 arg2, class_1297 arg3, class_2614 arg4)
onEntityCollided(World world, BlockPos pos, BlockState state, Entity entity, HopperBlockEntity blockEntity)
protected ScreenHandler
createMenu(int containerId, Inventory inventory)
method_5465(int arg0, class_1661 arg1)
createScreenHandler(int arg0, PlayerInventory arg1)
private static boolean
lambda$entityInside$1(HopperBlockEntity arg0, ItemEntity arg1)
method_31693(class_2614 arg0, class_1542 arg1)
method_31693(HopperBlockEntity arg0, ItemEntity arg1)
private static boolean
lambda$pushItemsTick$0(Level arg0, HopperBlockEntity arg1)
method_31691(class_1937 arg0, class_2614 arg1)
method_31691(World arg0, HopperBlockEntity arg1)