diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index d5db832f..35626769 100644 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -1275,10 +1275,24 @@ namespace TShockAPI /// The size square set of tiles to send. /// true if the tile square was sent successfully, else false public virtual bool SendTileSquare(int x, int y, int size = 10) + { + return SendTileRect((short)x, (short)y, (byte)size, (byte)size); + } + + /// + /// Sends a rectangle of tiles at a location with the given length and width. + /// + /// The x coordinate the rectangle will begin at + /// The y coordinate the rectangle will begin at + /// The width of the rectangle + /// The length of the rectangle + /// Optional change type. Default None + /// + public virtual bool SendTileRect(short x, short y, byte width = 10, byte length = 10, TileChangeType changeType = TileChangeType.None) { try { - SendData(PacketTypes.TileSendSquare, "", size, x, y); + NetMessage.SendTileSquare(Index, x, y, width, length, changeType); return true; } catch (Exception ex) @@ -1711,7 +1725,7 @@ namespace TShockAPI if (RealPlayer && !ConnectionAlive) 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); } ///