OnPlayerUpdate now uses GetDataHandledEventArgs.
This commit is contained in:
parent
649cd453d7
commit
c6c4446021
1 changed files with 5 additions and 5 deletions
|
|
@ -499,10 +499,8 @@ namespace TShockAPI
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For use in a PlayerUpdate event
|
/// For use in a PlayerUpdate event
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PlayerUpdateEventArgs : HandledEventArgs
|
public class PlayerUpdateEventArgs : GetDataHandledEventArgs
|
||||||
{
|
{
|
||||||
/// <summary>The TSPlayer object that triggered the event</summary>
|
|
||||||
public TSPlayer Player { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Terraria playerID of the player
|
/// The Terraria playerID of the player
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -531,7 +529,7 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static HandlerList<PlayerUpdateEventArgs> PlayerUpdate = new HandlerList<PlayerUpdateEventArgs>();
|
public static HandlerList<PlayerUpdateEventArgs> PlayerUpdate = new HandlerList<PlayerUpdateEventArgs>();
|
||||||
|
|
||||||
private static bool OnPlayerUpdate(TSPlayer player, byte plr, byte control, byte item, Vector2 position, Vector2 velocity, byte pulley)
|
private static bool OnPlayerUpdate(TSPlayer player, MemoryStream data, byte plr, byte control, byte item, Vector2 position, Vector2 velocity, byte pulley)
|
||||||
{
|
{
|
||||||
if (PlayerUpdate == null)
|
if (PlayerUpdate == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -539,6 +537,7 @@ namespace TShockAPI
|
||||||
var args = new PlayerUpdateEventArgs
|
var args = new PlayerUpdateEventArgs
|
||||||
{
|
{
|
||||||
Player = player,
|
Player = player,
|
||||||
|
Data = data,
|
||||||
PlayerId = plr,
|
PlayerId = plr,
|
||||||
Control = control,
|
Control = control,
|
||||||
Item = item,
|
Item = item,
|
||||||
|
|
@ -549,6 +548,7 @@ namespace TShockAPI
|
||||||
PlayerUpdate.Invoke(null, args);
|
PlayerUpdate.Invoke(null, args);
|
||||||
return args.Handled;
|
return args.Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool TSCheckNoclip(Vector2 Position, int Width, int Height)
|
public static bool TSCheckNoclip(Vector2 Position, int Width, int Height)
|
||||||
{
|
{
|
||||||
int num = (int)(Position.X / 16f);
|
int num = (int)(Position.X / 16f);
|
||||||
|
|
@ -2242,7 +2242,7 @@ namespace TShockAPI
|
||||||
if (pulley[2])
|
if (pulley[2])
|
||||||
vel = new Vector2(args.Data.ReadSingle(), args.Data.ReadSingle());
|
vel = new Vector2(args.Data.ReadSingle(), args.Data.ReadSingle());
|
||||||
|
|
||||||
if (OnPlayerUpdate(args.Player, plr, control, item, pos, vel, pulley))
|
if (OnPlayerUpdate(args.Player, args.Data, plr, control, item, pos, vel, pulley))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (control[5])
|
if (control[5])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue