Class BasicLootBlockEntity

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
net.tearpelato.deco_lib.api.block_entity.BasicLootBlockEntity
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.MenuProvider, net.minecraft.world.Nameable, net.minecraft.world.RandomizableContainer, net.minecraft.world.WorldlyContainer, net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.common.extensions.ContainerExtension, net.neoforged.neoforge.common.extensions.IBlockEntityExtension, net.neoforged.neoforge.common.extensions.IMenuProviderExtension, net.neoforged.neoforge.common.extensions.TypedInstanceExtension<net.minecraft.world.level.block.entity.BlockEntityType<?>>, net.neoforged.neoforge.registries.datamaps.IWithData<net.minecraft.world.level.block.entity.BlockEntityType<?>>

public abstract class BasicLootBlockEntity extends net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity implements net.minecraft.world.WorldlyContainer
  • 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
    Modifier and Type
    Field
    Description
    protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>
     
    protected final net.minecraft.world.level.block.entity.ContainerOpenersCounter
     

    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.RandomizableContainer

    LOOT_TABLE_SEED_TAG, LOOT_TABLE_TAG
  • Constructor Summary

    Constructors
    Constructor
    Description
    BasicLootBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    addItem(net.minecraft.world.item.ItemStack stack)
     
    boolean
    canPlaceItemThroughFace(int i, net.minecraft.world.item.ItemStack itemStack, @Nullable net.minecraft.core.Direction direction)
     
    boolean
    canTakeItemThroughFace(int i, net.minecraft.world.item.ItemStack itemStack, net.minecraft.core.Direction direction)
     
    protected abstract net.minecraft.world.inventory.AbstractContainerMenu
    createMenu(int windowId, net.minecraft.world.entity.player.Inventory playerInventory)
     
    abstract int
     
    protected abstract net.minecraft.network.chat.Component
     
    protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>
     
    int[]
    getSlotsForFace(net.minecraft.core.Direction direction)
     
    boolean
     
    boolean
     
    boolean
    isMatchingContainerMenu(net.minecraft.world.inventory.AbstractContainerMenu menu)
     
    void
    loadAdditional(net.minecraft.world.level.storage.ValueInput input)
     
    void
    onClose(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
    void
    onOpen(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
    protected void
    saveAdditional(net.minecraft.world.level.storage.ValueOutput output)
     
    protected void
    setItems(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items)
     
    void
     

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

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

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

    clearContent, getCustomName, getDisplayName, getName, isLocked, sendChestLockedNotifications, setItem, 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, iterator, removeItem, removeItemNoUpdate, setChanged, setItem, startOpen, stillValid, stopOpen

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

    onTransfer, setItem

    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

    applyStructureRotation, 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

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

    getData
  • Field Details

    • items

      protected net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items
    • openersCounter

      protected final net.minecraft.world.level.block.entity.ContainerOpenersCounter openersCounter
  • Constructor Details

    • BasicLootBlockEntity

      public BasicLootBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • getContainerSize

      public abstract int getContainerSize()
      Specified by:
      getContainerSize in interface net.minecraft.world.Container
    • isMatchingContainerMenu

      public boolean isMatchingContainerMenu(net.minecraft.world.inventory.AbstractContainerMenu menu)
    • getItems

      protected 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(net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items)
      Specified by:
      setItems in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • getDefaultName

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

      protected boolean addItem(net.minecraft.world.item.ItemStack stack)
    • createMenu

      protected abstract net.minecraft.world.inventory.AbstractContainerMenu createMenu(int windowId, net.minecraft.world.entity.player.Inventory playerInventory)
      Specified by:
      createMenu in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface net.minecraft.world.Container
      Overrides:
      isEmpty in class net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity
    • isFull

      public boolean isFull()
    • saveAdditional

      protected void saveAdditional(net.minecraft.world.level.storage.ValueOutput output)
      Overrides:
      saveAdditional in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • loadAdditional

      public void loadAdditional(net.minecraft.world.level.storage.ValueInput input)
      Overrides:
      loadAdditional in class net.minecraft.world.level.block.entity.BaseContainerBlockEntity
    • getSlotsForFace

      public int[] getSlotsForFace(net.minecraft.core.Direction direction)
      Specified by:
      getSlotsForFace in interface net.minecraft.world.WorldlyContainer
    • canPlaceItemThroughFace

      public boolean canPlaceItemThroughFace(int i, net.minecraft.world.item.ItemStack itemStack, @Nullable @Nullable net.minecraft.core.Direction direction)
      Specified by:
      canPlaceItemThroughFace in interface net.minecraft.world.WorldlyContainer
    • canTakeItemThroughFace

      public boolean canTakeItemThroughFace(int i, net.minecraft.world.item.ItemStack itemStack, net.minecraft.core.Direction direction)
      Specified by:
      canTakeItemThroughFace in interface net.minecraft.world.WorldlyContainer
    • updateOpenerCount

      public void updateOpenerCount()
    • onOpen

      public void onOpen(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
    • onClose

      public void onClose(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)