Class Container

java.lang.Object
org.geysermc.geyser.inventory.Inventory
org.geysermc.geyser.inventory.Container
Direct Known Subclasses:
AnvilContainer, BeaconContainer, CartographyContainer, EnchantingContainer, Generic3X3Container, LecternContainer, MerchantContainer, StonecutterContainer

public class Container extends Inventory
Combination of Inventory and PlayerInventory
  • Constructor Details

    • Container

      public Container(String title, int id, int size, com.github.steveice10.mc.protocol.data.game.inventory.ContainerType containerType, PlayerInventory playerInventory)
  • Method Details

    • getItem

      public GeyserItemStack getItem(int slot)
      Overrides:
      getItem in class Inventory
    • setItem

      public void setItem(int slot, @NonNull @NonNull GeyserItemStack newItem, GeyserSession session)
      Overrides:
      setItem in class Inventory
    • getSize

      public int getSize()
      Overrides:
      getSize in class Inventory
    • setUsingRealBlock

      public void setUsingRealBlock(boolean usingRealBlock, String javaBlockId)
      Will be overwritten for droppers.
      Parameters:
      usingRealBlock - whether this container is using a real container or not
      javaBlockId - the Java block string of the block, if real
    • getPlayerInventory

      public PlayerInventory getPlayerInventory()
    • getContainerSize

      public int getContainerSize()
    • isUsingRealBlock

      public boolean isUsingRealBlock()
      Whether we are using a real block when opening this inventory.