Single player on its server thread could not be opened to the LAN: the
window is a client of that server, and Open to LAN, /publish and
`horizon-ctl lan` tried to start a second hub on the window's side.
The server thread now publishes itself, as IntegratedServer.publishServer
does:
- The window asks its server with `Integrated::call` (executeBlocking):
a task run between two ticks, while paused too, with its answer.
- Publishing binds the port at once (a busy port fails right away), then
the hub starts listening and announcing the world (LanServerPinger)
with the MOTD "<owner> - <world>". Until then only the owner may log
in; afterwards anyone may, and status pings are answered.
- Unpublishing stops the listener and sends every player but the owner
away (multiplayer.disconnect.server_shutdown).
- /publish and /unpublish run on the server for the player who types
them, and the integrated server's command tree (with publish, without
the dedicated-only commands) is what its players get.
- The owner's level follows Allow Commands; other players get game
master commands only when guests may use commands and the world allows
them (IntegratedServer.getCustomPermissionLevel). Every player's
command runs at their own level.
- The world options screen reads and applies its settings on the
server: difficulty, default and personal game mode, Allow Commands and
the LAN settings; the window shows the outcome.
- A published world does not pause (Minecraft.pause needs
!isPublished), and F3+Escape follows the same rule.
- Memory connections are never compressed, whatever the threshold
(Connection.isMemoryConnection), so network players get the usual 256.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#528 was tested before #537 moved the asset registry from Resources to
the reloadable pack, so main stopped compiling after both merged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vanilla draws a section when its column is within the render distance of
the camera's column with a column of slack on each axis
(SectionOcclusionGraph.isInViewDistance → ChunkTrackingView): 533
columns at render distance 12. Horizon meshed a circle of radius 12 (441
columns) and drew sections whose centre lay within 16 x distance + 24
blocks, so the edge of the world, mostly in fog, missed columns vanilla
shows, and fell short of vanilla's corners.
`streaming::in_view_distance` is vanilla's test. Streaming meshes the
columns it accepts around the player (and forced ones), and the
renderer's column walk draws the ones it accepts around the camera.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A player who joins over the network, which is now single player's own
player on its server thread, had no status effects: what they drank, ate
or were given went to the host, and their client never heard of any.
- Each guest has their own effects. `as_guest` trades them, and what
their body was given for them (attribute modifiers, armor protection,
enchantment modifiers), with the host's while the guest acts.
- They tick on the server with the guest's body (LivingEntity.baseTick's
tickEffects), spectators included.
- The client is told as vanilla's ServerPlayer does: every effect when
placed (PlayerList.sendActivePlayerEffects), then added (blended),
updated, refreshed every 600 ticks left, and removed. An effect that
only counted down is not sent again.
- The client keeps its own effects from those packets
(LivingEntity.forceAddEffect), counts them down (tickClient), and its
predicted movement, HUD icons and night vision follow them. A respawn
starts without effects on both sides.
- Guests save and load them in their player file.
Saving also stops writing effects that have run out: the loaded player
compound kept the old `active_effects`, and they came back on reopen.
Potions in flight now tick on a server without a local player too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On its server thread a single-player world is joined like a server, so
the Horizon pause menu named it "Multiplayer" with a "Disconnect" button,
and F3+Escape opened the full menu as on a server. The server thread now
hands the window the world's name with its connection, the pause menu
shows that name and "Save and quit", and `has_singleplayer_server`
(Minecraft.hasSingleplayerServer) covers both ways of running a world for
the pause checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The integrated server draws nothing, but it built the window's full HUD
atlas (GUI, item, block, entity and particle textures plus the run-time
slots). It now builds an atlas of the font sheets only, reads the glyph
widths from it and drops the pixels: text still measures the same (books
split their pages with it), without holding the textures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The per-frame section walk iterated a SipHash map of every resident
section, then looked each visible one up twice more by key. Resident
sections now live in a dense list grouped by chunk column: one distance
and frustum test rejects a whole column (exact: a section's box lies in
its column's box and the plane test rounds monotonically), the rest are
reached by slot, and the visible list sorts on integer keys with ties
broken by section key, so the order no longer depends on hash order.
FaceGroups looks its axes up in a table instead of searching for them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>