Class NeoForgeWoodenHopperBlockEntity

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
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
de.cech12.woodenhopper.blockentity.NeoForgeWoodenHopperBlockEntity
All Implemented Interfaces:
Iterable<net.minecraft.world.item.ItemStack>, 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, net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.common.extensions.ContainerExtension, net.neoforged.neoforge.common.extensions.IBlockEntityExtension, net.neoforged.neoforge.common.extensions.IMenuProviderExtension

public class NeoForgeWoodenHopperBlockEntity extends WoodenHopperBlockEntity
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    net.neoforged.neoforge.attachment.AttachmentHolder.AsField

    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 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 class net.neoforged.neoforge.attachment.AttachmentHolder

    ATTACHMENTS_NBT_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
    NeoForgeWoodenHopperBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the number of slots in the inventory.
    protected 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 @NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>
     
    protected Object
     
    protected boolean
    isNotFull(Object itemHandlerObj)
     
    protected void
    loadAdditional(@NotNull net.minecraft.world.level.storage.ValueInput valueInput)
     
    void
    onTransfer(int slot, int amountChange, @NotNull net.neoforged.neoforge.transfer.transaction.TransactionContext transaction)
     
    protected boolean
     
    protected net.minecraft.world.item.ItemStack
    putStackInInventoryAllSlots(net.minecraft.world.level.block.entity.BlockEntity source, Object destination, Object destInventoryObj, net.minecraft.world.item.ItemStack stack)
     
    @NotNull net.minecraft.world.item.ItemStack
    removeItem(int index, int count)
    Removes up to a specified number of items from an inventory slot and returns them in a new stack.
    @NotNull net.minecraft.world.item.ItemStack
    removeItemNoUpdate(int index)
    Removes a stack from the given slot and returns it.
    void
    saveAdditional(@NotNull net.minecraft.world.level.storage.ValueOutput valueOutput)
     
    void
    setItem(int index, @NotNull net.minecraft.world.item.ItemStack stack, boolean insideTransaction)
    Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
    protected void
    setItems(@NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> itemsIn)
     

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

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

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

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

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

    addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getAndClearAttachmentTypesToSync, getBlockPos, getBlockState, getLevel, getNameForReporting, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, preRemoveSideEffects, problemPath, registerDebugValues, removeData, saveCustomOnly, saveCustomOnly, saveWithFullMetadata, saveWithFullMetadata, saveWithId, saveWithoutMetadata, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, syncData, triggerEvent, typeHolder

    Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, serializeAttachments

    Methods inherited from class 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, canTakeItem, countItem, getEntitiesWithContainerOpen, getItem, getMaxStackSize, getMaxStackSize, getSlot, hasAnyMatching, hasAnyOf, isEmpty, iterator, setChanged, setItem, startOpen, stillValid, stopOpen

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

    getSuckAabb

    Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder

    getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncData

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension

    getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IMenuProviderExtension

    shouldTriggerClientSideContainerClosingOnOpen, writeClientSideData

    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.minecraft.world.entity.SlotProvider

    getSlotsFromRange

    Methods inherited from interface net.minecraft.core.TypedInstance

    is, is, is, is, is, tags
  • Constructor Details

    • NeoForgeWoodenHopperBlockEntity

      public NeoForgeWoodenHopperBlockEntity(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 WoodenHopperBlockEntity
    • saveAdditional

      public void saveAdditional(@NotNull @NotNull net.minecraft.world.level.storage.ValueOutput valueOutput)
      Overrides:
      saveAdditional in class WoodenHopperBlockEntity
    • getContainerSize

      public int getContainerSize()
      Returns the number of slots in the inventory.
    • getItems

      @NotNull protected @NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getItems()
      Specified by:
      getItems in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • setItems

      protected void setItems(@NotNull @NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> itemsIn)
      Specified by:
      setItems in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • removeItem

      @NotNull public @NotNull net.minecraft.world.item.ItemStack removeItem(int index, int count)
      Removes up to a specified number of items from an inventory slot and returns them in a new stack.
      Specified by:
      removeItem in interface net.minecraft.world.Container
      Overrides:
      removeItem in class net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
    • removeItemNoUpdate

      @NotNull public @NotNull net.minecraft.world.item.ItemStack removeItemNoUpdate(int index)
      Removes a stack from the given slot and returns it.
      Specified by:
      removeItemNoUpdate in interface net.minecraft.world.Container
      Overrides:
      removeItemNoUpdate in class net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
    • setItem

      public void setItem(int index, @NotNull @NotNull net.minecraft.world.item.ItemStack stack, boolean insideTransaction)
      Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
      Specified by:
      setItem in interface net.neoforged.neoforge.common.extensions.ContainerExtension
      Overrides:
      setItem in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • putStackInInventoryAllSlots

      protected net.minecraft.world.item.ItemStack putStackInInventoryAllSlots(net.minecraft.world.level.block.entity.BlockEntity source, Object destination, Object destInventoryObj, net.minecraft.world.item.ItemStack stack)
      Specified by:
      putStackInInventoryAllSlots in class WoodenHopperBlockEntity
    • getItemHandler

      protected 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)
      Specified by:
      getItemHandler in class WoodenHopperBlockEntity
    • isNotFull

      protected boolean isNotFull(Object itemHandlerObj)
      Specified by:
      isNotFull in class WoodenHopperBlockEntity
    • pullItemsFromItemHandler

      protected boolean pullItemsFromItemHandler(Object itemHandler)
      Specified by:
      pullItemsFromItemHandler in class WoodenHopperBlockEntity
    • getOwnItemHandler

      protected Object getOwnItemHandler()
      Specified by:
      getOwnItemHandler in class WoodenHopperBlockEntity
    • onTransfer

      public void onTransfer(int slot, int amountChange, @NotNull @NotNull net.neoforged.neoforge.transfer.transaction.TransactionContext transaction)