OnSignEvent now uses GetDataHandledEventArgs.
This commit is contained in:
parent
3b25043d11
commit
82a749c24d
1 changed files with 5 additions and 3 deletions
|
|
@ -976,7 +976,7 @@ namespace TShockAPI
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For use in a Sign event
|
/// For use in a Sign event
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SignEventArgs : HandledEventArgs
|
public class SignEventArgs : GetDataHandledEventArgs
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Terraria playerID of the player
|
/// The Terraria playerID of the player
|
||||||
|
|
@ -996,13 +996,15 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static HandlerList<SignEventArgs> Sign = new HandlerList<SignEventArgs>();
|
public static HandlerList<SignEventArgs> Sign = new HandlerList<SignEventArgs>();
|
||||||
|
|
||||||
private static bool OnSignEvent(short id, int x, int y)
|
private static bool OnSignEvent(TSPlayer player, MemoryStream data, short id, int x, int y)
|
||||||
{
|
{
|
||||||
if (Sign == null)
|
if (Sign == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var args = new SignEventArgs
|
var args = new SignEventArgs
|
||||||
{
|
{
|
||||||
|
Player = player,
|
||||||
|
Data = data,
|
||||||
ID = id,
|
ID = id,
|
||||||
X = x,
|
X = x,
|
||||||
Y = y,
|
Y = y,
|
||||||
|
|
@ -2601,7 +2603,7 @@ namespace TShockAPI
|
||||||
var y = args.Data.ReadInt16();
|
var y = args.Data.ReadInt16();
|
||||||
args.Data.ReadString(); // Ignore sign text
|
args.Data.ReadString(); // Ignore sign text
|
||||||
|
|
||||||
if (OnSignEvent(id, x, y))
|
if (OnSignEvent(args.Player, args.Data, id, x, y))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (TShock.CheckTilePermission(args.Player, x, y))
|
if (TShock.CheckTilePermission(args.Player, x, y))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue