mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-04-26 17:07:55 +00:00
35 lines
1,010 B
C#
35 lines
1,010 B
C#
namespace Minecraft.Server.FourKit.Event.Inventory;
|
|
|
|
using Minecraft.Server.FourKit.Entity;
|
|
using Minecraft.Server.FourKit.Inventory;
|
|
|
|
/// <summary>
|
|
/// An abstract base class for events that describe an interaction between a
|
|
/// <see cref="HumanEntity"/> and the contents of an <see cref="Inventory"/>.
|
|
/// This is currently not emitted anywhere, use <see cref="InventoryClickEvent"/> instead.
|
|
/// </summary>
|
|
public abstract class InventoryInteractEvent : InventoryEvent, Cancellable
|
|
{
|
|
private bool _cancelled;
|
|
internal protected InventoryInteractEvent(InventoryView transaction) : base(transaction)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the player who performed the click.
|
|
/// </summary>
|
|
/// <returns>The clicking player.</returns>
|
|
public HumanEntity getWhoClicked()
|
|
{
|
|
return transaction.getPlayer();
|
|
}
|
|
|
|
|
|
/// <inheritdoc />
|
|
public bool isCancelled() => _cancelled;
|
|
|
|
|
|
/// <inheritdoc />
|
|
public void setCancelled(bool cancel) => _cancelled = cancel;
|
|
}
|