Interface IHeldBag
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
Bag is a non-placed block container, usually one that is attached to an entity
public interface IHeldBag
- Extension Methods
Methods
Clear(ItemStack)
Delete all contents of this bag
void Clear(ItemStack bagstack)
Parameters
bagstackItemStack
GetContents(ItemStack, IWorldAccessor)
Should return all contents of this bag
ItemStack[] GetContents(ItemStack bagstack, IWorldAccessor world)
Parameters
bagstackItemStackworldIWorldAccessor
Returns
GetOrCreateSlots(ItemStack, InventoryBase, int, IWorldAccessor)
List<ItemSlotBagContent> GetOrCreateSlots(ItemStack bagstack, InventoryBase parentinv, int bagIndex, IWorldAccessor world)
Parameters
bagstackItemStackparentinvInventoryBasebagIndexintworldIWorldAccessor
Returns
GetQuantitySlots(ItemStack)
Amount of slots this bag provides
int GetQuantitySlots(ItemStack bagstack)
Parameters
bagstackItemStack
Returns
GetSlotBgColor(ItemStack)
The Hex color the bag item slot should take, return null for default
string GetSlotBgColor(ItemStack bagstack)
Parameters
bagstackItemStack
Returns
GetStorageFlags(ItemStack)
The types of items that can be stored in this bag
EnumItemStorageFlags GetStorageFlags(ItemStack bagstack)
Parameters
bagstackItemStack
Returns
IsEmpty(ItemStack)
Should true if this this bag is empty
bool IsEmpty(ItemStack bagstack)
Parameters
bagstackItemStack
Returns
Store(ItemStack, ItemSlotBagContent)
Save given itemstack into this bag
void Store(ItemStack bagstack, ItemSlotBagContent slot)
Parameters
bagstackItemStackslotItemSlotBagContent