Class HopperBlockEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BaseContainerBlockEntity
net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
net.minecraft.world.level.block.entity.HopperBlockEntity
- All Implemented Interfaces:
Clearable
,Container
,MenuConstructor
,Hopper
,MenuProvider
,Nameable
,ICapabilityProvider
,ICapabilitySerializable<CompoundTag>
,IForgeBlockEntity
,INBTSerializable<CompoundTag>
-
Field Summary
Modifier and TypeFieldDescriptionprivate int
static int
private NonNullList<ItemStack>
static int
private long
Fields inherited from class net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
LOOT_TABLE_SEED_TAG, LOOT_TABLE_TAG, lootTable, lootTableSeed
Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPosition
Fields inherited from interface net.minecraft.world.Container
LARGE_MAX_STACK_SIZE
Fields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ItemStack
static boolean
addItem(Container p_59332_, ItemEntity p_59333_)
private static boolean
canMergeItems(ItemStack p_59345_, ItemStack p_59346_)
private static boolean
canPlaceItemInContainer(Container p_59335_, ItemStack p_59336_, int p_59337_, Direction p_59338_)
private static boolean
canTakeItemFromContainer(Container p_59381_, ItemStack p_59382_, int p_59383_, Direction p_59384_)
protected AbstractContainerMenu
createMenu(int p_59312_, Inventory p_59313_)
protected IItemHandler
private static boolean
ejectItems(Level p_155563_, BlockPos p_155564_, BlockState p_155565_, HopperBlockEntity p_155566_)
static void
entityInside(Level p_155568_, BlockPos p_155569_, BlockState p_155570_, Entity p_155571_, HopperBlockEntity p_155572_)
private static Container
getAttachedContainer(Level p_155593_, BlockPos p_155594_, BlockState p_155595_)
private static Container
getContainerAt(Level p_59348_, double p_59349_, double p_59350_, double p_59351_)
static Container
getContainerAt(Level p_59391_, BlockPos p_59392_)
int
protected Component
protected NonNullList<ItemStack>
getItems()
static List<ItemEntity>
getItemsAtAndAbove(Level p_155590_, Hopper p_155591_)
long
double
double
double
private static IntStream
private static Container
getSourceContainer(Level p_155597_, Hopper p_155598_)
private boolean
private static boolean
isEmptyContainer(Container p_59398_, Direction p_59399_)
private static boolean
isFullContainer(Container p_59386_, Direction p_59387_)
private boolean
boolean
void
load(CompoundTag p_155588_)
static void
pushItemsTick(Level p_155574_, BlockPos p_155575_, BlockState p_155576_, HopperBlockEntity p_155577_)
removeItem(int p_59309_, int p_59310_)
save(CompoundTag p_59375_)
void
setCooldown(int p_59396_)
void
protected void
setItems(NonNullList<ItemStack> p_59371_)
static boolean
suckInItems(Level p_155553_, Hopper p_155554_)
private static ItemStack
tryMoveInItem(Container p_59321_, Container p_59322_, ItemStack p_59323_, int p_59324_, Direction p_59325_)
private static boolean
tryMoveItems(Level p_155579_, BlockPos p_155580_, BlockState p_155581_, HopperBlockEntity p_155582_, BooleanSupplier p_155583_)
private static boolean
tryTakeInItemFromSlot(Hopper p_59355_, Container p_59356_, int p_59357_, Direction p_59358_)
Methods inherited from class net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
canOpen, clearContent, createMenu, getItem, isEmpty, removeItemNoUpdate, setLootTable, setLootTable, stillValid, tryLoadLootTable, trySaveLootTable, unpackLootTable
Methods inherited from class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
canUnlock, getCapability, getCustomName, getDisplayName, getName, invalidateCaps, reviveCaps, setCustomName
Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getTileData, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, setBlockState, setChanged, setChanged, setLevel, setRemoved, triggerEvent
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, serializeCaps
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.Clearable
clearContent
Methods inherited from interface net.minecraft.world.Container
canPlaceItem, countItem, getItem, getMaxStackSize, hasAnyOf, isEmpty, removeItemNoUpdate, setChanged, startOpen, stillValid, stopOpen
Methods inherited from interface net.minecraft.world.level.block.entity.Hopper
getSuckShape
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, getModelData, getRenderBoundingBox, handleUpdateTag, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
Methods inherited from interface net.minecraft.world.Nameable
hasCustomName
-
Field Details
-
MOVE_ITEM_SPEED
public static final int MOVE_ITEM_SPEED- See Also:
- Constant Field Values
-
HOPPER_CONTAINER_SIZE
public static final int HOPPER_CONTAINER_SIZE- See Also:
- Constant Field Values
-
items
-
cooldownTime
private int cooldownTime -
tickedGameTime
private long tickedGameTime
-
-
Constructor Details
-
HopperBlockEntity
-
-
Method Details
-
load
- Overrides:
load
in classBaseContainerBlockEntity
-
save
- Overrides:
save
in classBaseContainerBlockEntity
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSize
in interfaceContainer
-
removeItem
- Specified by:
removeItem
in interfaceContainer
- Overrides:
removeItem
in classRandomizableContainerBlockEntity
-
setItem
- Specified by:
setItem
in interfaceContainer
- Overrides:
setItem
in classRandomizableContainerBlockEntity
-
getDefaultName
- Specified by:
getDefaultName
in classBaseContainerBlockEntity
-
pushItemsTick
public static void pushItemsTick(Level p_155574_, BlockPos p_155575_, BlockState p_155576_, HopperBlockEntity p_155577_) -
tryMoveItems
private static boolean tryMoveItems(Level p_155579_, BlockPos p_155580_, BlockState p_155581_, HopperBlockEntity p_155582_, BooleanSupplier p_155583_) -
inventoryFull
private boolean inventoryFull() -
ejectItems
private static boolean ejectItems(Level p_155563_, BlockPos p_155564_, BlockState p_155565_, HopperBlockEntity p_155566_) -
getSlots
-
isFullContainer
-
isEmptyContainer
-
suckInItems
-
tryTakeInItemFromSlot
-
addItem
-
addItem
-
canPlaceItemInContainer
-
canTakeItemFromContainer
-
tryMoveInItem
-
getAttachedContainer
@Nullable private static Container getAttachedContainer(Level p_155593_, BlockPos p_155594_, BlockState p_155595_) -
getSourceContainer
-
getItemsAtAndAbove
-
getContainerAt
-
getContainerAt
-
canMergeItems
-
getLevelX
public double getLevelX() -
getLevelY
public double getLevelY() -
getLevelZ
public double getLevelZ() -
setCooldown
public void setCooldown(int p_59396_) -
isOnCooldown
private boolean isOnCooldown() -
isOnCustomCooldown
public boolean isOnCustomCooldown() -
getItems
- Specified by:
getItems
in classRandomizableContainerBlockEntity
-
setItems
- Specified by:
setItems
in classRandomizableContainerBlockEntity
-
entityInside
public static void entityInside(Level p_155568_, BlockPos p_155569_, BlockState p_155570_, Entity p_155571_, HopperBlockEntity p_155572_) -
createMenu
- Specified by:
createMenu
in classBaseContainerBlockEntity
-
createUnSidedHandler
- Overrides:
createUnSidedHandler
in classBaseContainerBlockEntity
-
getLastUpdateTime
public long getLastUpdateTime()
-