From 2f7514c0efc1c9411e7346bdb00852935c4a0533 Mon Sep 17 00:00:00 2001
From: AkjaHAsLk1IALk0MasH <46046453+AgaSpace@users.noreply.github.com>
Date: Sun, 14 May 2023 09:43:18 +0700
Subject: [PATCH] Added an overload for `TSPlayer.GiveItem`
Added `TShockAPI.NetItem` structure to the parameters.
---
TShockAPI/TSPlayer.cs | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs
index 79572412..8aadacdf 100644
--- a/TShockAPI/TSPlayer.cs
+++ b/TShockAPI/TSPlayer.cs
@@ -1566,6 +1566,15 @@ namespace TShockAPI
GiveItemByDrop(type, stack, prefix);
}
+ ///
+ /// Gives an item to the player.
+ ///
+ /// Item with data to be given to the player.
+ public virtual void GiveItem(NetItem item)
+ {
+ GiveItem(item.NetId, item.Stack, item.PrefixId);
+ }
+
private Item EmptySentinelItem = new Item();
private bool Depleted(Item item)