OnLiquidSet now uses GetDataHandledEventArgs.

This commit is contained in:
Lucas Nicodemus 2017-12-23 14:36:28 -07:00
parent 50104612cf
commit 4c3600f58d

View file

@ -808,10 +808,8 @@ namespace TShockAPI
/// <summary> /// <summary>
/// For use in a LiquidSet event /// For use in a LiquidSet event
/// </summary> /// </summary>
public class LiquidSetEventArgs : HandledEventArgs public class LiquidSetEventArgs : GetDataHandledEventArgs
{ {
/// <summary>The TSPlayer that triggered the event.</summary>
public TSPlayer Player { get; set; }
/// <summary> /// <summary>
/// X location of the tile /// X location of the tile
/// </summary> /// </summary>
@ -834,7 +832,7 @@ namespace TShockAPI
/// </summary> /// </summary>
public static HandlerList<LiquidSetEventArgs> LiquidSet = new HandlerList<LiquidSetEventArgs>(); public static HandlerList<LiquidSetEventArgs> LiquidSet = new HandlerList<LiquidSetEventArgs>();
private static bool OnLiquidSet(TSPlayer player, int tilex, int tiley, byte amount, byte type) private static bool OnLiquidSet(TSPlayer player, MemoryStream data, int tilex, int tiley, byte amount, byte type)
{ {
if (LiquidSet == null) if (LiquidSet == null)
return false; return false;
@ -842,6 +840,7 @@ namespace TShockAPI
var args = new LiquidSetEventArgs var args = new LiquidSetEventArgs
{ {
Player = player, Player = player,
Data = data,
TileX = tilex, TileX = tilex,
TileY = tiley, TileY = tiley,
Amount = amount, Amount = amount,
@ -2471,7 +2470,7 @@ namespace TShockAPI
byte amount = args.Data.ReadInt8(); byte amount = args.Data.ReadInt8();
byte type = args.Data.ReadInt8(); byte type = args.Data.ReadInt8();
if (OnLiquidSet(args.Player, tileX, tileY, amount, type)) if (OnLiquidSet(args.Player, args.Data, tileX, tileY, amount, type))
return true; return true;
return false; return false;