OnPlayerBuff now uses GetDataHandledEventArgs.
This commit is contained in:
parent
ed1a04b38b
commit
5d4a4f7067
1 changed files with 4 additions and 4 deletions
|
|
@ -1061,9 +1061,8 @@ namespace TShockAPI
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For use in a PlayerBuff event
|
/// For use in a PlayerBuff event
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PlayerBuffEventArgs : HandledEventArgs
|
public class PlayerBuffEventArgs : GetDataHandledEventArgs
|
||||||
{
|
{
|
||||||
public TSPlayer Player { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Terraria playerID of the player
|
/// The Terraria playerID of the player
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -1082,7 +1081,7 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static HandlerList<PlayerBuffEventArgs> PlayerBuff = new HandlerList<PlayerBuffEventArgs>();
|
public static HandlerList<PlayerBuffEventArgs> PlayerBuff = new HandlerList<PlayerBuffEventArgs>();
|
||||||
|
|
||||||
private static bool OnPlayerBuff(TSPlayer player, byte id, byte type, int time)
|
private static bool OnPlayerBuff(TSPlayer player, MemoryStream data, byte id, byte type, int time)
|
||||||
{
|
{
|
||||||
if (PlayerBuff == null)
|
if (PlayerBuff == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1090,6 +1089,7 @@ namespace TShockAPI
|
||||||
var args = new PlayerBuffEventArgs
|
var args = new PlayerBuffEventArgs
|
||||||
{
|
{
|
||||||
Player = player,
|
Player = player,
|
||||||
|
Data = data,
|
||||||
ID = id,
|
ID = id,
|
||||||
Type = type,
|
Type = type,
|
||||||
Time = time
|
Time = time
|
||||||
|
|
@ -2645,7 +2645,7 @@ namespace TShockAPI
|
||||||
var type = args.Data.ReadInt8();
|
var type = args.Data.ReadInt8();
|
||||||
var time = args.Data.ReadInt32();
|
var time = args.Data.ReadInt32();
|
||||||
|
|
||||||
if (OnPlayerBuff(args.Player, id, type, time))
|
if (OnPlayerBuff(args.Player, args.Data, id, type, time))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
args.Player.SendData(PacketTypes.PlayerAddBuff, "", id);
|
args.Player.SendData(PacketTypes.PlayerAddBuff, "", id);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue