Class InventoryTileEntity

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
com.pixelmonmod.pixelmon.blocks.tileentity.InventoryTileEntity
All Implemented Interfaces:
IBasicInventory, net.minecraft.world.Clearable, net.minecraft.world.Container, net.minecraft.world.inventory.MenuConstructor, net.minecraft.world.MenuProvider, net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.client.extensions.IMenuProviderExtension, net.neoforged.neoforge.common.extensions.IBlockEntityExtension
Direct Known Subclasses:
BoxTileEntity, EndTableTileEntity, FridgeTileEntity, MowerTileEntity

public abstract class InventoryTileEntity extends net.minecraft.world.level.block.entity.BlockEntity implements IBasicInventory, net.minecraft.world.MenuProvider
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity

    net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput

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

    net.neoforged.neoforge.attachment.AttachmentHolder.AsField
  • Field Summary

    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
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    InventoryTileEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, String inventoryName, int rows, net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    addToInventory(net.minecraft.world.item.ItemStack stack)
     
    net.minecraft.world.inventory.AbstractContainerMenu
    createMenu(int id, net.minecraft.world.entity.player.Inventory inventory, net.minecraft.world.entity.player.Player player)
     
    int
     
    net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>
     
     
    net.minecraft.network.chat.Component
     
    net.minecraft.world.item.ItemStack
    getItem(int index)
     
    int
     
    boolean
     
    boolean
     
    void
    loadAdditional(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider lookup)
     
    net.minecraft.world.item.ItemStack
    removeItem(int index, int count)
     
    net.minecraft.world.item.ItemStack
    removeItemNoUpdate(int index)
     
    void
    saveAdditional(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider lookup)
     
    void
    setItem(int index, net.minecraft.world.item.ItemStack stack)
     
    boolean
    stillValid(net.minecraft.world.entity.player.Player player)
     

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

    addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, removeData, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, triggerEvent

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

    deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachments

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

    canTakeItem, countItem, getMaxStackSize, hasAnyMatching, hasAnyOf, setChanged

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

    getData, getExistingData, hasData, removeData, setData

    Methods inherited from interface com.pixelmonmod.pixelmon.blocks.tileentity.IBasicInventory

    canPlaceItem, clearContent, startOpen, stopOpen

    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.client.extensions.IMenuProviderExtension

    shouldTriggerClientSideContainerClosingOnOpen, writeClientSideData
  • Constructor Details

    • InventoryTileEntity

      protected InventoryTileEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, String inventoryName, int rows, net.minecraft.core.BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockState)
  • Method Details

    • getContents

      public net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getContents()
    • loadAdditional

      public void loadAdditional(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider lookup)
      Overrides:
      loadAdditional in class net.minecraft.world.level.block.entity.BlockEntity
    • addToInventory

      public boolean addToInventory(net.minecraft.world.item.ItemStack stack)
    • saveAdditional

      public void saveAdditional(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider lookup)
      Overrides:
      saveAdditional in class net.minecraft.world.level.block.entity.BlockEntity
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface net.minecraft.world.Container
    • getItem

      public net.minecraft.world.item.ItemStack getItem(int index)
      Specified by:
      getItem in interface net.minecraft.world.Container
    • removeItem

      public net.minecraft.world.item.ItemStack removeItem(int index, int count)
      Specified by:
      removeItem in interface net.minecraft.world.Container
      Specified by:
      removeItem in interface IBasicInventory
    • removeItemNoUpdate

      public net.minecraft.world.item.ItemStack removeItemNoUpdate(int index)
      Specified by:
      removeItemNoUpdate in interface net.minecraft.world.Container
    • setItem

      public void setItem(int index, net.minecraft.world.item.ItemStack stack)
      Specified by:
      setItem in interface net.minecraft.world.Container
    • getMaxStackSize

      public int getMaxStackSize()
      Specified by:
      getMaxStackSize in interface net.minecraft.world.Container
      Specified by:
      getMaxStackSize in interface IBasicInventory
    • stillValid

      public boolean stillValid(net.minecraft.world.entity.player.Player player)
      Specified by:
      stillValid in interface net.minecraft.world.Container
    • getCustomName

      public String getCustomName()
    • hasCustomName

      public boolean hasCustomName()
    • getDisplayName

      public net.minecraft.network.chat.Component getDisplayName()
      Specified by:
      getDisplayName in interface net.minecraft.world.MenuProvider
    • createMenu

      public net.minecraft.world.inventory.AbstractContainerMenu createMenu(int id, net.minecraft.world.entity.player.Inventory inventory, net.minecraft.world.entity.player.Player player)
      Specified by:
      createMenu in interface net.minecraft.world.inventory.MenuConstructor
    • getContainerSize

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