Class InventoryHolder<T extends Inventory>

java.lang.Object
org.geysermc.geyser.inventory.InventoryHolder<T>

public final class InventoryHolder<T extends Inventory> extends Object
A helper class storing the current inventory, translator, and session.
  • Constructor Details

  • Method Details

    • markCurrent

      public void markCurrent()
    • shouldSetPending

      public boolean shouldSetPending()
    • shouldConfirmClose

      public boolean shouldConfirmClose(boolean confirm)
    • inheritFromExisting

      public void inheritFromExisting(InventoryHolder<? extends Inventory> existing)
    • updateInventory

      public void updateInventory()
    • updateProperty

      public void updateProperty(int rawProperty, int value)
    • updateSlot

      public void updateSlot(int slot)
    • openInventory

      public void openInventory()
    • closeInventory

      public void closeInventory(boolean force)
    • requiresOpeningDelay

      public boolean requiresOpeningDelay()
    • prepareInventory

      public boolean prepareInventory()
    • translateRequests

      public void translateRequests(List<org.cloudburstmc.protocol.bedrock.data.inventory.itemstack.request.ItemStackRequest> requests)
    • session

      public GeyserSession session()
    • inventory

      public T inventory()
    • translator

      public InventoryTranslator<T> translator()
    • incrementContainerOpenAttempts

      public void incrementContainerOpenAttempts()
    • javaId

      public int javaId()
    • bedrockId

      public int bedrockId()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • pending

      public boolean pending()
      Whether this inventory is currently pending. It can be pending if this inventory was opened while another inventory was still open, or because opening this inventory takes more time (e.g. virtual inventories).
    • containerOpenAttempts

      public int containerOpenAttempts()
      Stores the number of attempts to open virtual inventories. Capped at 3, and isn't used in ideal circumstances. Used to resolve container closing issues.
    • pending

      public InventoryHolder<T> pending(boolean pending)
      Whether this inventory is currently pending. It can be pending if this inventory was opened while another inventory was still open, or because opening this inventory takes more time (e.g. virtual inventories).
      Returns:
      this.
    • containerOpenAttempts

      public InventoryHolder<T> containerOpenAttempts(int containerOpenAttempts)
      Stores the number of attempts to open virtual inventories. Capped at 3, and isn't used in ideal circumstances. Used to resolve container closing issues.
      Returns:
      this.