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
bagstack
ItemStack
GetContents(ItemStack, IWorldAccessor)
Should return all contents of this bag
ItemStack[] GetContents(ItemStack bagstack, IWorldAccessor world)
Parameters
bagstack
ItemStackworld
IWorldAccessor
Returns
GetOrCreateSlots(ItemStack, InventoryBase, int, IWorldAccessor)
List<ItemSlotBagContent> GetOrCreateSlots(ItemStack bagstack, InventoryBase parentinv, int bagIndex, IWorldAccessor world)
Parameters
bagstack
ItemStackparentinv
InventoryBasebagIndex
intworld
IWorldAccessor
Returns
GetQuantitySlots(ItemStack)
Amount of slots this bag provides
int GetQuantitySlots(ItemStack bagstack)
Parameters
bagstack
ItemStack
Returns
GetSlotBgColor(ItemStack)
The Hex color the bag item slot should take, return null for default
string GetSlotBgColor(ItemStack bagstack)
Parameters
bagstack
ItemStack
Returns
GetStorageFlags(ItemStack)
The types of items that can be stored in this bag
EnumItemStorageFlags GetStorageFlags(ItemStack bagstack)
Parameters
bagstack
ItemStack
Returns
IsEmpty(ItemStack)
Should true if this this bag is empty
bool IsEmpty(ItemStack bagstack)
Parameters
bagstack
ItemStack
Returns
Store(ItemStack, ItemSlotBagContent)
Save given itemstack into this bag
void Store(ItemStack bagstack, ItemSlotBagContent slot)
Parameters
bagstack
ItemStackslot
ItemSlotBagContent