From 0b79a6bee4f8434178a264fba43ca4b4d755b45b Mon Sep 17 00:00:00 2001
From: Cai <13110818005@qq.com>
Date: Tue, 17 Jun 2025 06:44:28 +0800
Subject: [PATCH] refactor(Bouncer): remove RangeCheck for ChestOnQuickStack
operations and rename method
Players are not able to quick-stack items into out-of-range chests.
---
TShockAPI/Bouncer.cs | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs
index 238c0992..dde7f1a5 100644
--- a/TShockAPI/Bouncer.cs
+++ b/TShockAPI/Bouncer.cs
@@ -137,7 +137,7 @@ namespace TShockAPI
GetDataHandlers.KillMe += OnKillMe;
GetDataHandlers.FishOutNPC += OnFishOutNPC;
GetDataHandlers.FoodPlatterTryPlacing += OnFoodPlatterTryPlacing;
- OTAPI.Hooks.Chest.QuickStack += OnChestOnQuickStack;
+ OTAPI.Hooks.Chest.QuickStack += OnQuickStack;
// The following section is based off Player.PlaceThing_Tiles_PlaceIt and Player.PlaceThing_Tiles_PlaceIt_GetLegacyTileStyle.
@@ -2877,7 +2877,7 @@ namespace TShockAPI
///
///
///
- internal void OnChestOnQuickStack(object sender, OTAPI.Hooks.Chest.QuickStackEventArgs args)
+ internal void OnQuickStack(object sender, OTAPI.Hooks.Chest.QuickStackEventArgs args)
{
var id = args.ChestIndex;
var plr = TShock.Players[args.PlayerId];
@@ -2901,13 +2901,6 @@ namespace TShockAPI
args.Result = HookResult.Cancel;
return;
}
-
- if (!plr.IsInRange(Main.chest[id].x, Main.chest[id].y, 600/16))
- {
- TShock.Log.ConsoleDebug(GetString("Bouncer / OnQuickStack rejected from range check from {0}", plr.Name));
- args.Result = HookResult.Cancel;
- return;
- }
}
internal void OnSecondUpdate()