Class CompoundContainer

java.lang.Object
net.minecraft.world.CompoundContainer
All Implemented Interfaces:
Clearable, Container

public class CompoundContainer extends Object implements Container
  • Field Details

    • container1

      private final Container container1
    • container2

      private final Container container2
  • Constructor Details

    • CompoundContainer

      public CompoundContainer(Container pContainer1, Container pContainer2)
  • Method Details

    • getContainerSize

      public int getContainerSize()
      Specified by:
      getContainerSize in interface Container
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Container
    • contains

      public boolean contains(Container pInventory)
      Return whether the given inventory is part of this large chest.
    • getItem

      public ItemStack getItem(int pIndex)
      Returns the stack in the given slot.
      Specified by:
      getItem in interface Container
    • removeItem

      public ItemStack removeItem(int pIndex, int pCount)
      Removes up to a specified number of items from an inventory slot and returns them in a new stack.
      Specified by:
      removeItem in interface Container
    • removeItemNoUpdate

      public ItemStack removeItemNoUpdate(int pIndex)
      Removes a stack from the given slot and returns it.
      Specified by:
      removeItemNoUpdate in interface Container
    • setItem

      public void setItem(int pIndex, ItemStack pStack)
      Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
      Specified by:
      setItem in interface Container
    • getMaxStackSize

      public int getMaxStackSize()
      Specified by:
      getMaxStackSize in interface Container
    • setChanged

      public void setChanged()
      Specified by:
      setChanged in interface Container
    • stillValid

      public boolean stillValid(Player pPlayer)
      Don't rename this method to canInteractWith due to conflicts with Container
      Specified by:
      stillValid in interface Container
    • startOpen

      public void startOpen(Player pPlayer)
      Specified by:
      startOpen in interface Container
    • stopOpen

      public void stopOpen(Player pPlayer)
      Specified by:
      stopOpen in interface Container
    • canPlaceItem

      public boolean canPlaceItem(int pIndex, ItemStack pStack)
      Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. For guis use Slot.isItemValid
      Specified by:
      canPlaceItem in interface Container
    • clearContent

      public void clearContent()
      Specified by:
      clearContent in interface Clearable