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