OnPlayerBuffUpdate now uses GetDataHandledEventArgs.
This commit is contained in:
parent
cd07aaf62c
commit
1ff2d6566b
1 changed files with 5 additions and 3 deletions
|
|
@ -1400,7 +1400,7 @@ namespace TShockAPI
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For use in a PlayerBuffUpdate event
|
/// For use in a PlayerBuffUpdate event
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PlayerBuffUpdateEventArgs : HandledEventArgs
|
public class PlayerBuffUpdateEventArgs : GetDataHandledEventArgs
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Terraria playerID of the player
|
/// The Terraria playerID of the player
|
||||||
|
|
@ -1412,13 +1412,15 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static HandlerList<PlayerBuffUpdateEventArgs> PlayerBuffUpdate = new HandlerList<PlayerBuffUpdateEventArgs>();
|
public static HandlerList<PlayerBuffUpdateEventArgs> PlayerBuffUpdate = new HandlerList<PlayerBuffUpdateEventArgs>();
|
||||||
|
|
||||||
private static bool OnPlayerBuffUpdate(byte id)
|
private static bool OnPlayerBuffUpdate(TSPlayer player, MemoryStream data, byte id)
|
||||||
{
|
{
|
||||||
if (PlayerBuffUpdate == null)
|
if (PlayerBuffUpdate == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var args = new PlayerBuffUpdateEventArgs
|
var args = new PlayerBuffUpdateEventArgs
|
||||||
{
|
{
|
||||||
|
Player = player,
|
||||||
|
Data = data,
|
||||||
ID = id,
|
ID = id,
|
||||||
};
|
};
|
||||||
PlayerBuffUpdate.Invoke(null, args);
|
PlayerBuffUpdate.Invoke(null, args);
|
||||||
|
|
@ -2754,7 +2756,7 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
var id = args.Data.ReadInt8();
|
var id = args.Data.ReadInt8();
|
||||||
|
|
||||||
if (OnPlayerBuffUpdate(id))
|
if (OnPlayerBuffUpdate(args.Player, args.Data, id))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
for (int i = 0; i < Terraria.Player.maxBuffs; i++)
|
for (int i = 0; i < Terraria.Player.maxBuffs; i++)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue