OnItemDrop now uses GetDataHandledEventArgs.
This commit is contained in:
parent
5d4a4f7067
commit
d0efdc3939
1 changed files with 4 additions and 7 deletions
|
|
@ -1101,12 +1101,8 @@ namespace TShockAPI
|
|||
/// <summary>
|
||||
/// For use in an ItemDrop event
|
||||
/// </summary>
|
||||
public class ItemDropEventArgs : HandledEventArgs
|
||||
public class ItemDropEventArgs : GetDataHandledEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The player who sent message
|
||||
/// </summary>
|
||||
public TSPlayer Player { get; set; }
|
||||
/// <summary>
|
||||
/// ID of the item.
|
||||
/// If below 400 and NetID(Type) is 0 Then Set Null. If ItemID is 400 Then New Item
|
||||
|
|
@ -1142,7 +1138,7 @@ namespace TShockAPI
|
|||
/// </summary>
|
||||
public static HandlerList<ItemDropEventArgs> ItemDrop = new HandlerList<ItemDropEventArgs>();
|
||||
|
||||
private static bool OnItemDrop(TSPlayer player, short id, Vector2 pos, Vector2 vel, short stacks, byte prefix, bool noDelay, short type)
|
||||
private static bool OnItemDrop(TSPlayer player, MemoryStream data, short id, Vector2 pos, Vector2 vel, short stacks, byte prefix, bool noDelay, short type)
|
||||
{
|
||||
if (ItemDrop == null)
|
||||
return false;
|
||||
|
|
@ -1150,6 +1146,7 @@ namespace TShockAPI
|
|||
var args = new ItemDropEventArgs
|
||||
{
|
||||
Player = player,
|
||||
Data = data,
|
||||
ID = id,
|
||||
Position = pos,
|
||||
Velocity = vel,
|
||||
|
|
@ -2662,7 +2659,7 @@ namespace TShockAPI
|
|||
var noDelay = args.Data.ReadInt8() == 1;
|
||||
var type = args.Data.ReadInt16();
|
||||
|
||||
if (OnItemDrop(args.Player, id, pos, vel, stacks, prefix, noDelay, type))
|
||||
if (OnItemDrop(args.Player, args.Data, id, pos, vel, stacks, prefix, noDelay, type))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue