From 1b96ed8992110c5bbcc2ef952cc98459ea194dee Mon Sep 17 00:00:00 2001 From: Patrikkk Date: Fri, 25 Feb 2022 04:42:16 +0100 Subject: [PATCH 1/4] Adding EntitySource parameter to the used at NewNPC and NewItem methods. I've decided to use the DebugCommand entity source for anything server related, as it makes the most sense as source. Feel free to discuss. --- TShockAPI/TSPlayer.cs | 2 +- TShockAPI/TSServerPlayer.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index 6a04bf0c..7b452fe4 100644 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -1379,7 +1379,7 @@ namespace TShockAPI /// The item prefix. public virtual void GiveItem(int type, int stack, int prefix = 0) { - int itemIndex = Item.NewItem((int)X, (int)Y, TPlayer.width, TPlayer.height, type, stack, true, prefix, true); + int itemIndex = Item.NewItem(new EntitySource_DebugCommand(), (int)X, (int)Y, TPlayer.width, TPlayer.height, type, stack, true, prefix, true); SendData(PacketTypes.ItemDrop, "", itemIndex); } diff --git a/TShockAPI/TSServerPlayer.cs b/TShockAPI/TSServerPlayer.cs index d414d424..14ea674b 100644 --- a/TShockAPI/TSServerPlayer.cs +++ b/TShockAPI/TSServerPlayer.cs @@ -26,6 +26,7 @@ using TShockAPI; using TShockAPI.DB; using Terraria.Localization; using System.Linq; +using Terraria.DataStructures; namespace TShockAPI { @@ -166,7 +167,7 @@ namespace TShockAPI int spawnTileY; TShock.Utils.GetRandomClearTileWithInRange(startTileX, startTileY, tileXRange, tileYRange, out spawnTileX, out spawnTileY); - NPC.NewNPC(spawnTileX * 16, spawnTileY * 16, type); + NPC.NewNPC(new EntitySource_DebugCommand(), spawnTileX * 16, spawnTileY * 16, type); } } From e2e5c15be087bdf857b1a6be9c6fb9b284ea5af1 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Fri, 25 Feb 2022 00:47:22 -0800 Subject: [PATCH 2/4] Update submodule for OTAPI 2.0.0.48 --- TerrariaServerAPI | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TerrariaServerAPI b/TerrariaServerAPI index 53146693..16934495 160000 --- a/TerrariaServerAPI +++ b/TerrariaServerAPI @@ -1 +1 @@ -Subproject commit 5314669394193a8a9a6a40036e00bcf8838254af +Subproject commit 1693449540ba0788503e49e82690da0f4d8f74d9 From 9bcec7b2d87a4dbe5a96d666e2d83aa5a16cbf77 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Fri, 25 Feb 2022 00:48:43 -0800 Subject: [PATCH 3/4] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6868d958..c5fa0110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,10 +12,10 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Do not forget to sign every line you change with your name. (@hakusaro) * If there is no section called "Upcoming changes" below this line, please add one with `## Upcoming changes` as the first line, and then a bulleted item directly after with the first change. - ## Upcoming changes * Improved the `/grow` command to reduce code duplication, use `TileID` constants for less ambiguous types. (@drunderscore) * Fixed item dupe via /logout & NPC. (@Terrarxxn) +* Added preliminary support for Terraria 1.4.3.4 (@SignatureBeef, @Patrikkk, @hakusaro) ## TShock 4.5.13 * Added hook `GetDataHandlers.OnReleaseNpc` to handling ReleaseNPC packet and a bouncer to stops unregistered and logged out players on SSC servers from releasing critters NPC. The bouncer has additional filter to stops players who tried to release different critter using crafted packet, e.g. using bunny item to release golden bunny. (@tru321) From 18fcfe14c9d42efb80a613b268d8920c652b4f91 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Fri, 25 Feb 2022 01:08:13 -0800 Subject: [PATCH 4/4] Update submodule to target 91e94388f15bd9b40786e052ef1a06173830b09d --- TerrariaServerAPI | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TerrariaServerAPI b/TerrariaServerAPI index 16934495..91e94388 160000 --- a/TerrariaServerAPI +++ b/TerrariaServerAPI @@ -1 +1 @@ -Subproject commit 1693449540ba0788503e49e82690da0f4d8f74d9 +Subproject commit 91e94388f15bd9b40786e052ef1a06173830b09d