Class DummyInventory
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
A place holder inventory, useful, e.g., for when you want to render an itemstack and not have it spoil
public class DummyInventory : InventoryBase, IInventory, IReadOnlyCollection<ItemSlot>, IEnumerable<ItemSlot>, IEnumerable
- Inheritance
-
DummyInventory
- Implements
- Inherited Members
- Extension Methods
Constructors
DummyInventory(ICoreAPI, int)
public DummyInventory(ICoreAPI api, int quantitySlots = 1)
Parameters
Properties
Count
Returns the number of slots in this inventory.
public override int Count { get; }
Property Value
this[int]
Gets or sets the slot at the given slot number. Returns null for invalid slot number (below 0 or above Count-1). The setter allows for replacing slots with custom ones, though caution is advised.
public override ItemSlot this[int slotId] { get; set; }
Parameters
slotId
int
Property Value
Slots
public ItemSlot[] Slots { get; }
Property Value
- ItemSlot[]
Methods
FromTreeAttributes(ITreeAttribute)
Called when the game is loaded or loaded from server
public override void FromTreeAttributes(ITreeAttribute tree)
Parameters
tree
ITreeAttribute
GetTransitionSpeedMul(EnumTransitionType, ItemStack)
Does this inventory speed up or slow down a transition for given itemstack? (Default: 1 for perish and 0 otherwise)
public override float GetTransitionSpeedMul(EnumTransitionType transType, ItemStack stack)
Parameters
transType
EnumTransitionTypestack
ItemStack
Returns
ToTreeAttributes(ITreeAttribute)
Called when the game is saved or sent to client
public override void ToTreeAttributes(ITreeAttribute tree)
Parameters
tree
ITreeAttribute