Class Inventory

java.lang.Object
emu.grasscutter.game.inventory.Inventory
All Implemented Interfaces:
Iterable<GameItem>

public class Inventory extends Object implements Iterable<GameItem>
  • Constructor Details

    • Inventory

      public Inventory(Player player)
  • Method Details

    • getPlayer

      public Player getPlayer()
    • getAvatarStorage

      public AvatarStorage getAvatarStorage()
    • getItems

      public it.unimi.dsi.fastutil.longs.Long2ObjectMap<GameItem> getItems()
    • getInventoryTypes

      public it.unimi.dsi.fastutil.ints.Int2ObjectMap<InventoryTab> getInventoryTypes()
    • getInventoryTab

      public InventoryTab getInventoryTab(ItemType type)
    • createInventoryTab

      public void createInventoryTab(ItemType type, InventoryTab tab)
    • getItemByGuid

      public GameItem getItemByGuid(long id)
    • addItem

      public boolean addItem(int itemId)
    • addItem

      public boolean addItem(int itemId, int count)
    • addItem

      public boolean addItem(GameItem item)
    • addItem

      public boolean addItem(GameItem item, ActionReason reason)
    • addItem

      public boolean addItem(GameItem item, ActionReason reason, boolean forceNotify)
    • addItems

      public void addItems(Collection<GameItem> items)
    • addItems

      public void addItems(Collection<GameItem> items, ActionReason reason)
    • addItemParams

      public void addItemParams(Collection<emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam> items)
    • addItemParamDatas

      public void addItemParamDatas(Collection<ItemParamData> items)
    • addItemParamDatas

      public void addItemParamDatas(Collection<ItemParamData> items, ActionReason reason)
    • payItem

      public boolean payItem(int id, int count)
    • payItem

      public boolean payItem(ItemParamData costItem)
    • payItems

      public boolean payItems(ItemParamData[] costItems)
    • payItems

      public boolean payItems(ItemParamData[] costItems, int quantity)
    • payItems

      public boolean payItems(ItemParamData[] costItems, int quantity, ActionReason reason)
    • removeItems

      public void removeItems(List<GameItem> items)
    • removeItem

      public boolean removeItem(long guid)
    • removeItem

      public boolean removeItem(long guid, int count)
    • removeItem

      public boolean removeItem(GameItem item)
    • removeItem

      public boolean removeItem(GameItem item, int count)
    • equipItem

      public boolean equipItem(long avatarGuid, long equipGuid)
    • unequipItem

      public boolean unequipItem(long avatarGuid, int slot)
    • loadFromDatabase

      public void loadFromDatabase()
    • iterator

      public Iterator<GameItem> iterator()
      Specified by:
      iterator in interface Iterable<GameItem>