From 257b5e9f2d76c3d39e84a13754b2363d846cb8e9 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Fri, 16 Oct 2026 10:36:31 +0200 Subject: [PATCH] tools/lan_e2e.py: containers waits for the server's menu before reading or taking Co-Authored-By: Claude Opus 5.5 --- tools/lan_e2e.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/lan_e2e.py b/tools/lan_e2e.py index d77154c33..37a220e52 100755 --- a/tools/lan_e2e.py +++ b/tools/lan_e2e.py @@ -401,6 +401,14 @@ def open_container(guest, pos, out, label, take=None): """Open the container at `pos` and read it; `take` shift-clicks that container slot out first.""" guest.raw('interact', *pos) guest.raw('wait-for', 'screen', 'container', '--timeout', 10) + # The server's menu (an ender or double chest has no stand-in block entity: key i32::MIN), + # then its contents, can come a few ticks after the screen. + for _ in range(20): + guest.wait(2) + screen = guest('screen') + items = {s['slot']: s.get('item') for s in screen.get('slots', [])} + if screen.get('container') == [-2**31, 0, 0] and (take is None or items.get(300 + take)): + break guest.wait(5) if take is not None: guest.raw('click-slot', 300 + take, 'shift')