Update TSPlayer to allow sending tile rectangles
This commit is contained in:
parent
7ea1b8c482
commit
7122e5fb9a
1 changed files with 16 additions and 2 deletions
|
|
@ -1275,10 +1275,24 @@ namespace TShockAPI
|
||||||
/// <param name="size">The size square set of tiles to send.</param>
|
/// <param name="size">The size square set of tiles to send.</param>
|
||||||
/// <returns>true if the tile square was sent successfully, else false</returns>
|
/// <returns>true if the tile square was sent successfully, else false</returns>
|
||||||
public virtual bool SendTileSquare(int x, int y, int size = 10)
|
public virtual bool SendTileSquare(int x, int y, int size = 10)
|
||||||
|
{
|
||||||
|
return SendTileRect((short)x, (short)y, (byte)size, (byte)size);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sends a rectangle of tiles at a location with the given length and width.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="x">The x coordinate the rectangle will begin at</param>
|
||||||
|
/// <param name="y">The y coordinate the rectangle will begin at</param>
|
||||||
|
/// <param name="width">The width of the rectangle</param>
|
||||||
|
/// <param name="length">The length of the rectangle</param>
|
||||||
|
/// <param name="changeType">Optional change type. Default None</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public virtual bool SendTileRect(short x, short y, byte width = 10, byte length = 10, TileChangeType changeType = TileChangeType.None)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SendData(PacketTypes.TileSendSquare, "", size, x, y);
|
NetMessage.SendTileSquare(Index, x, y, width, length, changeType);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
@ -1711,7 +1725,7 @@ namespace TShockAPI
|
||||||
if (RealPlayer && !ConnectionAlive)
|
if (RealPlayer && !ConnectionAlive)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
NetMessage.SendData((int)msgType, Index, -1, NetworkText.FromLiteral(text), number, number2, number3, number4, number5);
|
NetMessage.SendData((int)msgType, Index, -1, text == null ? null : NetworkText.FromLiteral(text), number, number2, number3, number4, number5);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue