From 1ff2d6566b4b08e13a52118e12fa04cf0932efcf Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 23 Dec 2017 15:34:28 -0700 Subject: [PATCH] OnPlayerBuffUpdate now uses GetDataHandledEventArgs. --- TShockAPI/GetDataHandlers.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 807ce0dd..87438810 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1400,7 +1400,7 @@ namespace TShockAPI /// /// For use in a PlayerBuffUpdate event /// - public class PlayerBuffUpdateEventArgs : HandledEventArgs + public class PlayerBuffUpdateEventArgs : GetDataHandledEventArgs { /// /// The Terraria playerID of the player @@ -1412,13 +1412,15 @@ namespace TShockAPI /// public static HandlerList PlayerBuffUpdate = new HandlerList(); - private static bool OnPlayerBuffUpdate(byte id) + private static bool OnPlayerBuffUpdate(TSPlayer player, MemoryStream data, byte id) { if (PlayerBuffUpdate == null) return false; var args = new PlayerBuffUpdateEventArgs { + Player = player, + Data = data, ID = id, }; PlayerBuffUpdate.Invoke(null, args); @@ -2754,7 +2756,7 @@ namespace TShockAPI { var id = args.Data.ReadInt8(); - if (OnPlayerBuffUpdate(id)) + if (OnPlayerBuffUpdate(args.Player, args.Data, id)) return true; for (int i = 0; i < Terraria.Player.maxBuffs; i++)