Class SimpleItemContainer

java.lang.Object
earth.terrarium.botarium.common.item.SimpleItemContainer
All Implemented Interfaces:
SerializableContainer, Serializable, net.minecraft.world.Clearable, net.minecraft.world.Container

public class SimpleItemContainer extends Object implements SerializableContainer
  • Field Summary

    Fields inherited from interface net.minecraft.world.Container

    DEFAULT_DISTANCE_LIMIT, LARGE_MAX_STACK_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
    SimpleItemContainer(net.minecraft.world.level.block.entity.BlockEntity entity, int size)
     
    SimpleItemContainer(net.minecraft.world.level.block.entity.BlockEntity entity, int size, Predicate<net.minecraft.world.entity.player.Player> canPlayerAccess)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    deserialize(net.minecraft.nbt.CompoundTag nbt)
    Deserializes the information of an object from a CompoundTag.
    int
     
    net.minecraft.world.item.ItemStack
    getItem(int i)
     
    net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>
     
    boolean
     
    net.minecraft.world.item.ItemStack
    removeItem(int i, int j)
     
    net.minecraft.world.item.ItemStack
     
    net.minecraft.nbt.CompoundTag
    serialize(net.minecraft.nbt.CompoundTag nbt)
    Serializes the information of an object to a CompoundTag.
    void
     
    void
    setItem(int i, net.minecraft.world.item.ItemStack itemStack)
     
    boolean
    stillValid(net.minecraft.world.entity.player.Player player)
     

    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

    canPlaceItem, canTakeItem, countItem, getMaxStackSize, hasAnyMatching, hasAnyOf, startOpen, stopOpen
  • Constructor Details

    • SimpleItemContainer

      public SimpleItemContainer(net.minecraft.world.level.block.entity.BlockEntity entity, int size, Predicate<net.minecraft.world.entity.player.Player> canPlayerAccess)
    • SimpleItemContainer

      public SimpleItemContainer(net.minecraft.world.level.block.entity.BlockEntity entity, int size)
  • Method Details

    • deserialize

      public void deserialize(net.minecraft.nbt.CompoundTag nbt)
      Description copied from interface: Serializable
      Deserializes the information of an object from a CompoundTag.
      Specified by:
      deserialize in interface Serializable
      Parameters:
      nbt - The CompoundTag to deserialize from.
    • serialize

      public net.minecraft.nbt.CompoundTag serialize(net.minecraft.nbt.CompoundTag nbt)
      Description copied from interface: Serializable
      Serializes the information of an object to a CompoundTag.
      Specified by:
      serialize in interface Serializable
      Parameters:
      nbt - The CompoundTag to serialize to.
      Returns:
      The CompoundTag that was passed in but with the information of the object serialized added to it.
    • getContainerSize

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

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

      public net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getItems()
    • getItem

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

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

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

      public void setItem(int i, net.minecraft.world.item.ItemStack itemStack)
      Specified by:
      setItem in interface net.minecraft.world.Container
    • setChanged

      public void setChanged()
      Specified by:
      setChanged in interface net.minecraft.world.Container
    • stillValid

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

      public void clearContent()
      Specified by:
      clearContent in interface net.minecraft.world.Clearable