From 7702d3b00b4ebd11cb676ff6cf1dbab6f8c952a1 Mon Sep 17 00:00:00 2001 From: xuyuwtu <3082068984@qq.com> Date: Thu, 29 Jan 2026 10:29:43 +0800 Subject: [PATCH] fix Tests Reference; restore IgnoreSSCPackets = false in PlayerData --- TShockAPI/PlayerData.cs | 9 ++++++--- TShockLauncher.Tests/TShockLauncher.Tests.csproj | 6 ++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/TShockAPI/PlayerData.cs b/TShockAPI/PlayerData.cs index 5f4cc63b..e88303f2 100644 --- a/TShockAPI/PlayerData.cs +++ b/TShockAPI/PlayerData.cs @@ -614,13 +614,16 @@ namespace TShockAPI } } + // 别删了,ItemOwner那边应该是依赖于原版的一个行为会发包恢复,现在好像没了,先用这个 + player.IgnoreSSCPackets = false; } - public static void TrySendingItemArray(int plr, Item[] array, int slotStartIndex,int remoteClient = -1, int ignoreClient = -1) + private static void TrySendingItemArray(int plr, Item[] array, int slotStartIndex,int remoteClient = -1, int ignoreClient = -1) { - for (int index = 0; index < array.Length; ++index) - NetMessage.TrySendData(5, number: plr, number2: (float) (slotStartIndex + index),remoteClient: remoteClient, ignoreClient: ignoreClient); + { + NetMessage.TrySendData(5, number: plr, number2: slotStartIndex + index, remoteClient: remoteClient, ignoreClient: ignoreClient); + } } } } diff --git a/TShockLauncher.Tests/TShockLauncher.Tests.csproj b/TShockLauncher.Tests/TShockLauncher.Tests.csproj index 9be3968a..2192df81 100644 --- a/TShockLauncher.Tests/TShockLauncher.Tests.csproj +++ b/TShockLauncher.Tests/TShockLauncher.Tests.csproj @@ -21,6 +21,12 @@ + + ..\lib\OTAPI.dll + + + ..\lib\OTAPI.Runtime.dll +