mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-04-28 18:05:14 +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
42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
namespace Minecraft.Server.FourKit.Event.Player;
|
|
|
|
using Minecraft.Server.FourKit.Entity;
|
|
|
|
/// <summary>
|
|
/// Thrown when a player picks an item up from the ground.
|
|
/// If cancelled the item will not be picked up.
|
|
/// </summary>
|
|
public class PlayerPickupItemEvent : PlayerEvent, Cancellable
|
|
{
|
|
private readonly Item _item;
|
|
private readonly int _remaining;
|
|
private bool _cancelled;
|
|
internal PlayerPickupItemEvent(Player player, Item item, int remaining)
|
|
: base(player)
|
|
{
|
|
_item = item;
|
|
_remaining = remaining;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the Item picked up by the player.
|
|
/// </summary>
|
|
/// <returns>The <see cref="Item"/> entity.</returns>
|
|
public Item getItem() => _item;
|
|
|
|
/// <summary>
|
|
/// Gets the amount remaining on the ground, if any.
|
|
/// </summary>
|
|
/// <returns>Amount remaining on the ground.</returns>
|
|
public int getRemaining() => _remaining;
|
|
|
|
/// <inheritdoc/>
|
|
public bool isCancelled() => _cancelled;
|
|
|
|
/// <inheritdoc/>
|
|
public void setCancelled(bool cancel)
|
|
{
|
|
_cancelled = cancel;
|
|
}
|
|
}
|