Commit 48143e1
fix(headless): actually check readiness in pregenerateChunks
#5024: PrepareWorld.step() loops until worldRenderer.pregenerateChunks()
returns true or 5 seconds elapse. HeadlessWorldRenderer.pregenerateChunks()
was an unimplemented stub that always returned false, so headless runs
(including every MTE test) always burned the full 5 second wait
regardless of how quickly the world actually generated.
## Fix
Implemented pregenerateChunks() using the same chunk-loaded/local-view
check updateChunksInProximity() already performs for per-frame updates:
advance chunkProvider, force a full rescan of the current view region,
and report done once every chunk in it is loaded.
The rescan has to be forced: updateChunksInProximity's own
"did the camera move" shortcut is keyed off chunkPos, which never
changes in headless (NullCamera reports a constant position), so an
unforced call would never re-examine chunk state and permanently report
"nothing pending" from its zero-value default - a different way to end
up with the always-true failure mode keturn already ran into on a bare
`return true`, without ever confirming anything actually loaded.
## Verification
:engine:compileJava clean. Ran the full integrationenvironment test
suite (engine-tests:integrationTest, 18 MTE test classes covering
per-class and per-method lifecycles back-to-back in the same JVM,
34 tests total) - the exact scenario keturn's earlier attempt broke
("first test fine, next one had problems") - all 34 pass, 0 failures.
Fixes #5024
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 338d7dd commit 48143e1
1 file changed
Lines changed: 6 additions & 2 deletions
File tree
- engine/src/main/java/org/terasology/engine/core/subsystem/headless/renderer
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
137 | 141 | | |
138 | 142 | | |
139 | 143 | | |
| |||
0 commit comments