namespace Minecraft.Server.FourKit.Event.Player;
using Minecraft.Server.FourKit.Entity;
using Minecraft.Server.FourKit.Inventory;
// Yo this event pissed me the fuck off
///
/// Fired when a player drops an item from their inventory.
/// If cancelled, the item will not be dropped and the player keeps it.
/// The dropped item can be modified by plugins.
///
public class PlayerDropItemEvent : PlayerEvent, Cancellable
{
private ItemStack _itemDrop;
private bool _cancelled;
internal PlayerDropItemEvent(Player player, ItemStack drop)
: base(player)
{
_itemDrop = drop;
}
///
/// Gets the ItemDrop created by the player.
///
/// The ItemStack being dropped.
public ItemStack getItemDrop() => _itemDrop;
///
/// Sets the item to be dropped. Plugins can modify which item
/// is actually dropped.
///
/// The new item to drop.
public void setItemDrop(ItemStack item)
{
_itemDrop = item;
}
///
public bool isCancelled() => _cancelled;
///
public void setCancelled(bool cancel)
{
_cancelled = cancel;
}
}