mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-04-28 09:55:43 +00:00
Theres documentation at https://sylvessa.zip/fourkit/ now. And a bunch of other changes. Check the discord server for a more comprehensive list
46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
namespace Minecraft.Server.FourKit.Event.Inventory;
|
|
|
|
using Minecraft.Server.FourKit.Entity;
|
|
using Minecraft.Server.FourKit.Inventory;
|
|
|
|
/// <summary>
|
|
/// Represents a player related inventory event.
|
|
/// </summary>
|
|
public class InventoryEvent : Event
|
|
{
|
|
/// <summary>The inventory view associated with this event.</summary>
|
|
protected readonly InventoryView transaction;
|
|
internal InventoryEvent(InventoryView transaction)
|
|
{
|
|
this.transaction = transaction;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the primary Inventory involved in this transaction.
|
|
/// </summary>
|
|
/// <returns>The upper inventory.</returns>
|
|
public global::Minecraft.Server.FourKit.Inventory.Inventory getInventory()
|
|
{
|
|
return transaction.getTopInventory();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the list of players viewing the primary (upper) inventory
|
|
/// involved in this event.
|
|
/// </summary>
|
|
/// <returns>A list of people viewing.</returns>
|
|
public List<HumanEntity> getViewers()
|
|
{
|
|
return transaction.getTopInventory().getViewers();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the view object itself.
|
|
/// </summary>
|
|
/// <returns>The InventoryView.</returns>
|
|
public InventoryView getView()
|
|
{
|
|
return transaction;
|
|
}
|
|
}
|