Accept vanilla's clockless time sync in the LAN bot test

MinecraftServer.forceGameTimeSynchronization broadcasts SetTime with no
clocks every 20 ticks, and it can reach a joining bot before
PlayerList.sendLevelInfo's full sync. Wait for a sync with clocks instead
of failing on the first packet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-11 14:16:34 +02:00
parent 6734879ff7
commit 45b8861a85
+3 -4
View File
@@ -333,10 +333,9 @@ fn status_and_join() {
}));
teleported = true;
}
C::SetTime(t) => {
assert!(!t.clocks.is_empty());
time = true;
}
// The join's full clock sync; MinecraftServer's 20-tick
// forceGameTimeSynchronization sends no clocks and may come first.
C::SetTime(t) if !t.clocks.is_empty() => time = true,
C::PlayerInfoUpdate(u) => {
info |= u.entries.iter().any(|e| e.name.as_deref() == Some("Host"));
}