From 6e18d1c81f18e364b639186ad25a03a28e5d0222 Mon Sep 17 00:00:00 2001 From: NianGao Dev Date: Sat, 15 Aug 2026 23:49:59 +0800 Subject: [PATCH] =?UTF-8?q?test(game):=20=E6=B5=8B=E8=AF=95=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E7=A6=81=E7=94=A8=E8=87=AA=E7=84=B6=E5=88=B7=E6=80=AA?= =?UTF-8?q?=E6=B6=88=E9=99=A4=E6=97=B6=E5=BA=8F=20flake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/game/game_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/game/game_test.go b/internal/game/game_test.go index cec1826a..095ff652 100644 --- a/internal/game/game_test.go +++ b/internal/game/game_test.go @@ -64,7 +64,10 @@ func newTestSession(t *testing.T) *Session { inv := inventory.New(items) inv.Slots[0] = item.Stack{Name: "diamond_pickaxe", Count: 1} // 选中的工具 inv.Slots[1] = item.Stack{Name: "oak_planks", Count: 10} - return NewSession(w, reg, items, recipes, p, inv, cam) + sess := NewSession(w, reg, items, recipes, p, inv, cam) + // 测试环境禁用自然刷怪(僵尸生成依赖区块加载时序,会造成 flake) + sess.spawnTimer = 1e9 + return sess } // TestBreakAndPlace 完整闭环:破坏地表 → 放木板(方块交互与动画.md §3、§6)。