Class Inventory

java.lang.Object
org.geysermc.geyser.inventory.Inventory
Direct Known Subclasses:
Container, PlayerInventory

public abstract class Inventory extends Object
  • Field Details

    • id

      protected final int id
    • size

      protected final int size
    • containerType

      protected final com.github.steveice10.mc.protocol.data.game.inventory.ContainerType containerType
      Used for smooth transitions between two windows of the same type.
    • title

      protected final String title
    • items

      protected final GeyserItemStack[] items
    • holderPosition

      protected com.nukkitx.math.vector.Vector3i holderPosition
      The location of the inventory block. Will either be a fake block above the player's head, or the actual block location
    • holderId

      protected long holderId
  • Constructor Details

    • Inventory

      protected Inventory(int id, int size, com.github.steveice10.mc.protocol.data.game.inventory.ContainerType containerType)
    • Inventory

      protected Inventory(String title, int id, int size, com.github.steveice10.mc.protocol.data.game.inventory.ContainerType containerType)
  • Method Details

    • getItem

      public GeyserItemStack getItem(int slot)
    • getOffsetForHotbar

      public abstract int getOffsetForHotbar(@org.jetbrains.annotations.Range(from=0L, to=8L) int slot)
    • setItem

      public void setItem(int slot, @Nonnull GeyserItemStack newItem, GeyserSession session)
    • updateItemNetId

      protected void updateItemNetId(GeyserItemStack oldItem, GeyserItemStack newItem, GeyserSession session)
    • incrementStateId

      public void incrementStateId(int count)
      See ClickPlan.execute(boolean) for more details.
    • resetNextStateId

      public void resetNextStateId()