OnTileEdit is now a GetDataHandledEventArgs.
This commit is contained in:
parent
fe62b14a13
commit
301125b2d8
1 changed files with 4 additions and 8 deletions
|
|
@ -80,13 +80,8 @@ namespace TShockAPI
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used when a TileEdit event is called.
|
/// Used when a TileEdit event is called.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TileEditEventArgs : HandledEventArgs
|
public class TileEditEventArgs : GetDataHandledEventArgs
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// The TSPlayer who made the tile edit
|
|
||||||
/// </summary>
|
|
||||||
public TSPlayer Player { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The tile coordinate on the X plane
|
/// The tile coordinate on the X plane
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -122,7 +117,7 @@ namespace TShockAPI
|
||||||
/// TileEdit - called when a tile is placed or destroyed
|
/// TileEdit - called when a tile is placed or destroyed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static HandlerList<TileEditEventArgs> TileEdit = new HandlerList<TileEditEventArgs>();
|
public static HandlerList<TileEditEventArgs> TileEdit = new HandlerList<TileEditEventArgs>();
|
||||||
private static bool OnTileEdit(TSPlayer ply, int x, int y, EditAction action, EditType editDetail, short editData, byte style)
|
private static bool OnTileEdit(TSPlayer ply, MemoryStream data, int x, int y, EditAction action, EditType editDetail, short editData, byte style)
|
||||||
{
|
{
|
||||||
if (TileEdit == null)
|
if (TileEdit == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -130,6 +125,7 @@ namespace TShockAPI
|
||||||
var args = new TileEditEventArgs
|
var args = new TileEditEventArgs
|
||||||
{
|
{
|
||||||
Player = ply,
|
Player = ply,
|
||||||
|
Data = data,
|
||||||
X = x,
|
X = x,
|
||||||
Y = y,
|
Y = y,
|
||||||
Action = action,
|
Action = action,
|
||||||
|
|
@ -2077,7 +2073,7 @@ namespace TShockAPI
|
||||||
|
|
||||||
var style = args.Data.ReadInt8();
|
var style = args.Data.ReadInt8();
|
||||||
|
|
||||||
if (OnTileEdit(args.Player, tileX, tileY, action, type, editData, style))
|
if (OnTileEdit(args.Player, args.Data, tileX, tileY, action, type, editData, style))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue