Class WoodenHopperBlockEntity

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.woodenhopper.blockentity.WoodenHopperBlockEntity
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:
FabricWoodenHopperBlockEntity

public abstract class WoodenHopperBlockEntity 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.ContainerIterator

    Nested 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

    Fields
    Modifier and Type
    Field
    Description
    protected long
     
    protected int
     

    Fields inherited from class net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity

    lootTable, lootTableSeed

    Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity

    level, remove, worldPosition

    Fields inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget

    NBT_ATTACHMENT_KEY

    Fields inherited from interface net.minecraft.world.Container

    DEFAULT_DISTANCE_BUFFER

    Fields inherited from interface net.minecraft.world.level.block.entity.Hopper

    SUCK_AABB

    Fields inherited from interface net.minecraft.world.RandomizableContainer

    LOOT_TABLE_SEED_TAG, LOOT_TABLE_TAG
  • Constructor Summary

    Constructors
    Constructor
    Description
    WoodenHopperBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected @NotNull net.minecraft.world.inventory.AbstractContainerMenu
    createMenu(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.Component
     
    protected abstract Optional<org.apache.commons.lang3.tuple.Pair<Object,Object>>
    getItemHandler(net.minecraft.world.level.Level level, double x, double y, double z, net.minecraft.core.Direction side)
     
    protected long
     
    double
    Gets the world X position for this hopper entity.
    double
    Gets the world Y position for this hopper entity.
    double
    Gets the world Z position for this hopper entity.
    protected abstract Object
     
    boolean
     
    protected abstract boolean
    isNotFull(Object itemHandler)
     
    protected boolean
     
    protected void
    loadAdditional(@NotNull net.minecraft.world.level.storage.ValueInput valueInput)
     
    boolean
     
    void
    onItemEntityIsCaptured(net.minecraft.world.entity.item.ItemEntity itemEntity)
     
    protected boolean
    Pull dropped EntityItems from the world above the hopper and items from any inventory attached to this hopper into the hopper's inventory.
    protected abstract boolean
     
    protected abstract net.minecraft.world.item.ItemStack
    putStackInInventoryAllSlots(net.minecraft.world.level.block.entity.BlockEntity source, Object destination, Object destInventory, net.minecraft.world.item.ItemStack stack)
     
    void
    saveAdditional(@NotNull net.minecraft.world.level.storage.ValueOutput valueOutput)
     
    void
     
    static void
    tick(net.minecraft.world.level.Level level, WoodenHopperBlockEntity entity)
     
    protected void
    updateCooldown(boolean inventoryWasEmpty, net.minecraft.world.level.block.entity.BlockEntity source, Object destination)
     
    protected void
     

    Methods inherited from class net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity

    applyImplicitComponents, canOpen, collectImplicitComponents, createMenu, getItem, getLootTable, getLootTableSeed, isEmpty, removeComponentsFromTag, removeItem, removeItemNoUpdate, setItem, setLootTable, setLootTableSeed

    Methods inherited from class net.minecraft.world.level.block.entity.BaseContainerBlockEntity

    clearContent, getCustomName, getDisplayName, getItems, getName, isLocked, sendChestLockedNotifications, setItems, stillValid

    Methods 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, typeHolder

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget

    getAttached, getAttachedOrCreate, getAttachedOrCreate, getAttachedOrElse, getAttachedOrGet, getAttachedOrSet, getAttachedOrThrow, hasAttached, modifyAttached, onAttachedSet, removeAttached, setAttached

    Methods inherited from interface net.minecraft.world.Clearable

    clearContent

    Methods 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, stopOpen

    Methods inherited from interface net.fabricmc.fabric.api.menu.v1.FabricMenuProvider

    shouldCloseCurrentScreen

    Methods inherited from interface net.minecraft.world.level.block.entity.Hopper

    getSuckAabb

    Methods inherited from interface Iterable

    forEach, spliterator

    Methods inherited from interface net.minecraft.world.Nameable

    getPlainTextName, hasCustomName

    Methods inherited from interface net.minecraft.world.RandomizableContainer

    getBlockPos, getLevel, setLootTable, tryLoadLootTable, trySaveLootTable, unpackLootTable

    Methods inherited from interface net.fabricmc.fabric.api.blockgetter.v2.RenderDataBlockEntity

    getRenderData

    Methods inherited from interface net.minecraft.world.entity.SlotProvider

    getSlotsFromRange

    Methods 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

    • WoodenHopperBlockEntity

      public WoodenHopperBlockEntity(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:
      loadAdditional in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • saveAdditional

      public void saveAdditional(@NotNull @NotNull net.minecraft.world.level.storage.ValueOutput valueOutput)
      Overrides:
      saveAdditional in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • getDefaultName

      @NotNull protected @NotNull net.minecraft.network.chat.Component getDefaultName()
      Specified by:
      getDefaultName in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • getLevelX

      public double getLevelX()
      Gets the world X position for this hopper entity.
      Specified by:
      getLevelX in interface net.minecraft.world.level.block.entity.Hopper
    • getLevelY

      public double getLevelY()
      Gets the world Y position for this hopper entity.
      Specified by:
      getLevelY in interface net.minecraft.world.level.block.entity.Hopper
    • getLevelZ

      public double getLevelZ()
      Gets the world Z position for this hopper entity.
      Specified by:
      getLevelZ in interface net.minecraft.world.level.block.entity.Hopper
    • isGridAligned

      public boolean isGridAligned()
      Specified by:
      isGridAligned in interface net.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:
      createMenu in class net.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

      public 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)
    • tick

      public static void tick(net.minecraft.world.level.Level level, WoodenHopperBlockEntity entity)
    • onItemEntityIsCaptured

      public void onItemEntityIsCaptured(net.minecraft.world.entity.item.ItemEntity itemEntity)
    • putStackInInventoryAllSlots

      protected abstract net.minecraft.world.item.ItemStack putStackInInventoryAllSlots(net.minecraft.world.level.block.entity.BlockEntity source, Object destination, Object destInventory, net.minecraft.world.item.ItemStack stack)
    • getItemHandler

      protected abstract Optional<org.apache.commons.lang3.tuple.Pair<Object,Object>> getItemHandler(net.minecraft.world.level.Level level, double x, double y, double z, net.minecraft.core.Direction side)
    • isNotFull

      protected abstract boolean isNotFull(Object itemHandler)
    • pullItemsFromItemHandler

      protected abstract boolean pullItemsFromItemHandler(Object itemHandler)
    • getOwnItemHandler

      protected abstract Object 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

      protected void updateHopper(Supplier<Boolean> p_200109_1_)