Class BrickHopperBlockEntity
java.lang.Object
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BaseContainerBlockEntity
net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
de.cech12.brickhopper.blockentity.BrickHopperBlockEntity
- All Implemented Interfaces:
Iterable<net.minecraft.world.item.ItemStack>, net.fabricmc.fabric.api.attachment.v1.AttachmentTarget, net.fabricmc.fabric.api.blockgetter.v2.RenderDataBlockEntity, net.fabricmc.fabric.api.menu.v1.FabricMenuProvider, net.minecraft.core.TypedInstance<net.minecraft.world.level.block.entity.BlockEntityType<?>>, net.minecraft.util.debug.DebugValueSource, net.minecraft.world.Clearable, net.minecraft.world.Container, net.minecraft.world.entity.SlotProvider, net.minecraft.world.inventory.MenuConstructor, net.minecraft.world.level.block.entity.Hopper, net.minecraft.world.MenuProvider, net.minecraft.world.Nameable, net.minecraft.world.RandomizableContainer
- Direct Known Subclasses:
FabricBrickHopperBlockEntity
public abstract class BrickHopperBlockEntity
extends net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
implements net.minecraft.world.level.block.entity.Hopper
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget
net.fabricmc.fabric.api.attachment.v1.AttachmentTarget.OnAttachedSet<A>Nested classes/interfaces inherited from interface net.minecraft.world.Container
net.minecraft.world.Container.ContainerIteratorNested classes/interfaces inherited from interface net.minecraft.util.debug.DebugValueSource
net.minecraft.util.debug.DebugValueSource.Registration, net.minecraft.util.debug.DebugValueSource.ValueGetter<T> -
Field Summary
FieldsFields inherited from class net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
lootTable, lootTableSeedFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget
NBT_ATTACHMENT_KEYFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFERFields inherited from interface net.minecraft.world.level.block.entity.Hopper
SUCK_AABBFields inherited from interface net.minecraft.world.RandomizableContainer
LOOT_TABLE_SEED_TAG, LOOT_TABLE_TAG -
Constructor Summary
ConstructorsConstructorDescriptionBrickHopperBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionprotected @NotNull net.minecraft.world.inventory.AbstractContainerMenucreateMenu(int id, @NotNull net.minecraft.world.entity.player.Inventory player) static List<net.minecraft.world.entity.Entity> getAllAliveEntitiesAt(net.minecraft.world.level.Level level, double x, double y, double z, Predicate<? super net.minecraft.world.entity.Entity> filter) protected @NotNull net.minecraft.network.chat.ComponentgetItemHandler(net.minecraft.world.level.Level level, double x, double y, double z, net.minecraft.core.Direction side) protected longdoubleGets the world X position for this hopper entity.doubleGets the world Y position for this hopper entity.doubleGets the world Z position for this hopper entity.protected abstract Objectbooleanprotected abstract booleanprotected booleanprotected voidloadAdditional(@NotNull net.minecraft.world.level.storage.ValueInput valueInput) booleanvoidonItemEntityIsCaptured(net.minecraft.world.entity.item.ItemEntity itemEntity) protected booleanPull dropped EntityItems from the world above the hopper and items from any inventory attached to this hopper into the hopper's inventory.protected abstract booleanpullItemsFromItemHandler(Object itemHandler) protected abstract net.minecraft.world.item.ItemStackputStackInInventoryAllSlots(net.minecraft.world.level.block.entity.BlockEntity source, Object destination, Object destInventory, net.minecraft.world.item.ItemStack stack) voidsaveAdditional(@NotNull net.minecraft.world.level.storage.ValueOutput valueOutput) voidsetTransferCooldown(int ticks) static voidtick(net.minecraft.world.level.Level level, BrickHopperBlockEntity entity) protected voidupdateCooldown(boolean inventoryWasEmpty, net.minecraft.world.level.block.entity.BlockEntity source, Object destination) protected voidupdateHopper(Supplier<Boolean> p_200109_1_) Methods inherited from class net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
applyImplicitComponents, canOpen, collectImplicitComponents, createMenu, getItem, getLootTable, getLootTableSeed, isEmpty, removeComponentsFromTag, removeItem, removeItemNoUpdate, setItem, setLootTable, setLootTableSeedMethods inherited from class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
clearContent, getCustomName, getDisplayName, getItems, getName, isLocked, sendChestLockedNotifications, setItems, stillValidMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getNameForReporting, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, preRemoveSideEffects, problemPath, registerDebugValues, saveCustomOnly, saveCustomOnly, saveWithFullMetadata, saveWithFullMetadata, saveWithId, saveWithoutMetadata, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setLevel, setRemoved, triggerEvent, typeHolderMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget
getAttached, getAttachedOrCreate, getAttachedOrCreate, getAttachedOrElse, getAttachedOrGet, getAttachedOrSet, getAttachedOrThrow, hasAttached, modifyAttached, onAttachedSet, removeAttached, setAttachedMethods inherited from interface net.minecraft.world.Clearable
clearContentMethods inherited from interface net.minecraft.world.Container
canPlaceItem, canTakeItem, countItem, getContainerSize, getEntitiesWithContainerOpen, getItem, getMaxStackSize, getMaxStackSize, getSlot, hasAnyMatching, hasAnyOf, isEmpty, iterator, removeItem, removeItemNoUpdate, setChanged, setItem, startOpen, stillValid, stopOpenMethods inherited from interface net.fabricmc.fabric.api.menu.v1.FabricMenuProvider
shouldCloseCurrentScreenMethods inherited from interface net.minecraft.world.level.block.entity.Hopper
getSuckAabbMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface net.minecraft.world.Nameable
getPlainTextName, hasCustomNameMethods inherited from interface net.minecraft.world.RandomizableContainer
getBlockPos, getLevel, setLootTable, tryLoadLootTable, trySaveLootTable, unpackLootTableMethods inherited from interface net.fabricmc.fabric.api.blockgetter.v2.RenderDataBlockEntity
getRenderDataMethods inherited from interface net.minecraft.world.entity.SlotProvider
getSlotsFromRangeMethods inherited from interface net.minecraft.core.TypedInstance
is, is, is, is, is, tags
-
Field Details
-
transferCooldown
protected int transferCooldown -
tickedGameTime
protected long tickedGameTime
-
-
Constructor Details
-
BrickHopperBlockEntity
public BrickHopperBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
loadAdditional
protected void loadAdditional(@NotNull @NotNull net.minecraft.world.level.storage.ValueInput valueInput) - Overrides:
loadAdditionalin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
saveAdditional
public void saveAdditional(@NotNull @NotNull net.minecraft.world.level.storage.ValueOutput valueOutput) - Overrides:
saveAdditionalin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
getDefaultName
@NotNull protected @NotNull net.minecraft.network.chat.Component getDefaultName()- Specified by:
getDefaultNamein classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
getLevelX
public double getLevelX()Gets the world X position for this hopper entity.- Specified by:
getLevelXin interfacenet.minecraft.world.level.block.entity.Hopper
-
getLevelY
public double getLevelY()Gets the world Y position for this hopper entity.- Specified by:
getLevelYin interfacenet.minecraft.world.level.block.entity.Hopper
-
getLevelZ
public double getLevelZ()Gets the world Z position for this hopper entity.- Specified by:
getLevelZin interfacenet.minecraft.world.level.block.entity.Hopper
-
isGridAligned
public boolean isGridAligned()- Specified by:
isGridAlignedin interfacenet.minecraft.world.level.block.entity.Hopper
-
createMenu
@NotNull protected @NotNull net.minecraft.world.inventory.AbstractContainerMenu createMenu(int id, @NotNull @NotNull net.minecraft.world.entity.player.Inventory player) - Specified by:
createMenuin classnet.minecraft.world.level.block.entity.BaseContainerBlockEntity
-
setTransferCooldown
public void setTransferCooldown(int ticks) -
isNotOnTransferCooldown
protected boolean isNotOnTransferCooldown() -
mayNotTransfer
public boolean mayNotTransfer() -
getLastUpdateTime
protected long getLastUpdateTime() -
getAllAliveEntitiesAt
-
tick
-
onItemEntityIsCaptured
public void onItemEntityIsCaptured(net.minecraft.world.entity.item.ItemEntity itemEntity) -
putStackInInventoryAllSlots
-
getItemHandler
-
isNotFull
-
pullItemsFromItemHandler
-
getOwnItemHandler
-
pullItems
protected boolean pullItems()Pull dropped EntityItems from the world above the hopper and items from any inventory attached to this hopper into the hopper's inventory.- Returns:
- whether any items were successfully added to the hopper
-
updateCooldown
protected void updateCooldown(boolean inventoryWasEmpty, net.minecraft.world.level.block.entity.BlockEntity source, Object destination) -
updateHopper
-