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:
@@ -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"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user