test(game): 测试环境禁用自然刷怪消除时序 flake

This commit is contained in:
NianGao Dev
2026-08-15 23:49:59 +08:00
parent 90e33380fc
commit 6e18d1c81f

View File

@@ -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)。