test(game): 修正放置用例(抬升玩家脱离坑位)
This commit is contained in:
@@ -88,8 +88,10 @@ func TestBreakAndPlace(t *testing.T) {
|
||||
t.Fatal("破坏后应为空气")
|
||||
}
|
||||
|
||||
// 放置木板(切换到槽 1)
|
||||
// 放置木板(切换到槽 1):先抬升玩家脱离坑位(否则放置位与玩家 AABB 重叠会被正确拒绝)
|
||||
s.Inv.Selected = 1
|
||||
s.Player.Pos[1] += 2
|
||||
s.Tick(1.0 / 20) // 相机跟随
|
||||
s.PlaceSelected()
|
||||
if name := s.Reg.Name(s.World.Block(tx, ty, tz).ID()); name != "oak_planks" {
|
||||
t.Fatalf("放置后应为橡木板,实际 %s", name)
|
||||
|
||||
Reference in New Issue
Block a user