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 Open in GitHub
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
slotIdint
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
treeITreeAttribute
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
transTypeEnumTransitionTypestackItemStack
Returns
ToTreeAttributes(ITreeAttribute)
Called when the game is saved or sent to client
public override void ToTreeAttributes(ITreeAttribute tree)
Parameters
treeITreeAttribute