Class BaseContainer
- Namespace
- Obsidian.API
- Assembly
- Obsidian.API.dll
public abstract class BaseContainer : IEnumerable<ItemStack>, IEnumerable
- Inheritance
-
BaseContainer
- Implements
-
- Derived
-
- Inherited Members
-
Constructors
BaseContainer(int)
public BaseContainer(int size)
Parameters
size
int
Fields
items
protected ItemStack?[] items
Field Value
- ItemStack[]
Properties
this[int]
public ItemStack? this[int index] { get; set; }
Parameters
index
int
Property Value
- ItemStack
Size
Property Value
- int
Title
public ChatMessage Title { get; set; }
Property Value
- ChatMessage
Type
public InventoryType Type { get; }
Property Value
- InventoryType
Uuid
public Guid Uuid { get; }
Property Value
- Guid
Viewers
public List<IPlayer> Viewers { get; }
Property Value
- List<IPlayer>
Methods
AddItem(ItemStack)
public virtual int AddItem(ItemStack item)
Parameters
item
ItemStack
Returns
- int
GetDifference(int)
public virtual (int slot, bool forPlayer) GetDifference(int clickedSlot)
Parameters
clickedSlot
int
Returns
- (int slot, bool forPlayer)
GetEnumerator()
public IEnumerator<ItemStack> GetEnumerator()
Returns
- IEnumerator<ItemStack>
GetItem(int)
public virtual ItemStack? GetItem(int slot)
Parameters
slot
int
Returns
- ItemStack
HasItems()
Returns
- bool
RemoveItem(int)
public virtual bool RemoveItem(int slot)
Parameters
slot
int
Returns
- bool
RemoveItem(int, out ItemStack?)
public virtual bool RemoveItem(int slot, out ItemStack? removedItem)
Parameters
slot
int
removedItem
ItemStack
Returns
- bool
RemoveItem(int, int)
public virtual bool RemoveItem(int slot, int amount)
Parameters
slot
int
amount
int
Returns
- bool
RemoveItem(int, int, out ItemStack?)
public virtual bool RemoveItem(int slot, int amount, out ItemStack? removedItem)
Parameters
slot
int
amount
int
removedItem
ItemStack
Returns
- bool
Resize(int)
public virtual void Resize(int newSize)
Parameters
newSize
int
SetItem(int, ItemStack?)
public virtual void SetItem(int slot, ItemStack? item)
Parameters
slot
int
item
ItemStack