Commit Graph

3685 Commits

Author SHA1 Message Date
Cosmic e0d6e56281 Release Wayland surface before replacing the pack renderer 2026-10-16 22:41:33 -04:00
Cosmic 5515cbab33 Handle resource pack reload failures and reset menu atlas cache 2026-10-16 22:34:01 -04:00
Ludovic Marie 107671b1e8 Merge pull request #547 from Online5277/fix/banner-item-components
Fix Ominous Banner data, tooltips and breaking effects
2026-10-17 04:31:41 +02:00
Ludovic Marie 2e98f6a18a Let the behaviour profiler use a snapshot folder
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:25:02 +02:00
Ludovic Marie e7f7236c34 Open furnaces, blast furnaces and smokers on a server
Right-clicking a furnace as a guest did nothing: the host only handed
chests, barrels, hoppers, dispensers and shulker boxes over. It now opens
the furnace's own menu (minecraft:furnace, blast_furnace or smoker),
runs the guest's clicks through the host's AbstractFurnaceMenu (fuel slot,
take-only result, shift-clicks by recipe and fuel, a new input restarts
cooking) and keeps the client's progress arrows in step with
ContainerSetData. The dedicated server harness now opens a furnace and
smelts an ore in it on both servers.

Fixes #540

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:17:54 +02:00
Ludovic Marie 40970589be Wrap mixed translation arguments once, so vanilla clients can read /give
component_nbt wrapped the numbers of a mixed list under the empty key, and
the NBT writer then wrapped those wrappers again, as ListTag.wrapIfNeeded
does. A vanilla client reading /give's reply ("Gave 1 [Raw Iron] to ...")
unwrapped once, found a {"": 1} argument and dropped the connection. The
list is now left to the writer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:17:54 +02:00
Ludovic Marie d9dc5de701 Merge pull request #567 from ludovic111/perf/villager-poi-index
Villagers search an index of POI blocks instead of scanning every block
2026-10-17 04:07:54 +02:00
Ludovic Marie 892b8ca743 Merge pull request #591 from ludovic111/perf/stronghold-ring-cache
Returning to the Overworld reuses its stronghold ring positions
2026-10-17 04:07:42 +02:00
Ludovic Marie 0789bf0719 Keep the behaviours snapshot in the game folder, keyed to the build
The resource folder is shared: worktrees and parity harnesses link one copy,
and the launcher copies a prepared folder to each new compatible version. A
snapshot there would be read by builds that resolve the tables differently
while the VERSION constant stays the same. Keep it in the game's own
.horizon-cache (set by the client; tools, tests and servers don't cache), add
the running executable to its key, and skip hashing the resources when there
is no snapshot. Postcard without default features drops heapless and the
unmaintained atomic-polyfill from the lockfile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:06:23 +02:00
Cosmic 6d8b174216 Depth-test inventory preview equipment and clip it with a scissor 2026-10-16 22:03:57 -04:00
Ludovic Marie 5ad2d80908 Merge perf/sp-open-to-lan into perf/sp-server-state
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 03:51:11 +02:00
Ludovic Marie c2f2e15643 Merge main into perf/sp-open-to-lan
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 03:51:10 +02:00
Ludovic Marie 1d79cf69e1 Merge pull request #602 from ludovic111/perf/vanilla-view-distance
Draw the columns vanilla draws (ChunkTrackingView.isInViewDistance)
2026-10-17 03:48:27 +02:00
Ludovic Marie 604d83ddcd Merge pull request #596 from ludovic111/perf/sp-server-effects
Network players have status effects
2026-10-17 03:48:19 +02:00
Ludovic Marie 2ea6689f46 Merge pull request #570 from ludovic111/perf/sp-pause-labels
Integrated server: single-player pause menu labels
2026-10-17 03:48:15 +02:00
Ludovic Marie c2c7d7f4bb Merge pull request #569 from ludovic111/perf/sp-server-fonts-atlas
Integrated server: build only the font, not the whole HUD atlas
2026-10-17 03:48:11 +02:00
Cosmic cf7ed868b9 Light redstone ore when mining begins 2026-10-16 21:46:47 -04:00
Cosmic d98ee9a760 Route mouse-bound hotbar keys through container swaps 2026-10-16 21:44:57 -04:00
LookImEcho-Rick cde0703645 Merge main and preserve capture and mining release behavior 2026-10-16 20:44:16 -05:00
Cosmic 8fa5c38663 Add an optional Fullbright extra 2026-10-16 21:42:01 -04:00
Ludovic Marie 803aee8beb Merge perf/sp-open-to-lan (with main) into perf/sp-server-state
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 03:41:16 +02:00
Ludovic Marie bbed107a6a Merge main into perf/sp-open-to-lan
integrated.rs: keep both the LAN port flag and #594's smoothed tick time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 03:41:08 +02:00
Cosmic fab2a7cb06 Expose Horizon Extras in Classic Options 2026-10-16 21:40:07 -04:00
rdbtCVS 2a593ea64f Merge remote-tracking branch 'origin/main' into perf/shared-block-json-20261017 2026-10-17 02:37:52 +01:00
rdbtCVS ef633b252f test: run parity from worktrees and document startup profiles 2026-10-17 02:37:44 +01:00
Cosmic b174299f25 Match vanilla player render scale and inventory title height 2026-10-16 21:37:36 -04:00
Cosmic b2f0af559b Accept and handle mouse bindings for Extras 2026-10-16 21:34:18 -04:00
Ludovic Marie ac87384749 Merge pull request #594 from Online5277/fix/debug-packet-rates
Show live packet rates and server brands in F3
2026-10-17 03:31:54 +02:00
rdbtCVS 7b7c4eb083 Merge remote-tracking branch 'origin/main' into perf/shared-block-json-20261017 2026-10-17 02:27:02 +01:00
rdbtCVS 73ac737ccf perf: release startup decode buffers and profile parsing tradeoffs 2026-10-17 02:26:56 +01:00
Ludovic Marie 24ac4e149b Swap and sync the off hand on a server
On a server the F key swapped the hands only on the client, and the
inventory menu's off-hand slot (InventoryMenu slot 45) was missing from the
client's slot table, so clicks on it went nowhere and the server's updates
of it were dropped (#543).

- F sends ServerboundPlayerActionPacket SWAP_ITEM_WITH_OFFHAND and predicts
  nothing, as vanilla's Minecraft.handleKeybinds does (not for spectators).
- Inventory menu slot 45 is the off hand; SetPlayerInventory slot 40 too.
- The server swaps only for non-spectators and stops the item in use
  (ServerGamePacketListenerImpl.handlePlayerAction).

Fixes #543

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 03:17:16 +02:00
Ludovic Marie 256ecc4daa Keep server blocks in sync with what guests dig
A guest's STOP_DESTROY_BLOCK cleared the digging before the host's own
count was done, so a block the client broke stayed on the server and the
player fell through or froze on it. The host now follows
ServerPlayerGameMode: it breaks the block when its progress since START is
at least 0.7 and otherwise finishes the dig alone (the delayed destroy).
Block acks go out after the tick's block updates, and the client keeps
predicted blocks until the server acknowledges them
(BlockStatePredictionHandler), so a refused break comes back instead of
being lost.

Fixes #500

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 03:16:38 +02:00
Ludovic Marie 66d187ed06 Respawn on a server in vanilla's order, so vanilla clients leave the loading screen
A vanilla 26.3 client that died on a Horizon server stayed on its loading
screen after pressing Respawn (#566): ClientPacketListener.handleRespawn
starts a LevelLoadTracker that waits for the level info's "level chunks
load start" game event and the chunk under the player, and Horizon's
respawn sent neither the level info nor the chunk cache centre.

The hub's respawn now follows PlayerList.respawn: the entities paired with
the dead player are removed (one packet each), its chunks are dropped
without ForgetLevelChunk (as PlayerChunkSender does for a dead player) and
sent again, the abilities, then Respawn (with the last death location),
the teleport to the spawn facing its direction, the default spawn,
difficulty, experience, post effects, the level info, the permission
level, the chunk cache centre and the inventory. A dying guest also gets
the death animation event and no health update while dead, as vanilla's
ServerPlayer.die does.

Guests' commands also ran at the host's permission level: an operator on
a dedicated server could not run operator commands (and LAN guests ran
the host's level). They now run at the guest's own level, as the command
tree they are sent says.

The dedicated server harness covers it: after trading, the vanilla-codec
client is made an operator by the console, runs /kill, respawns, and the
packets from the death screen to the respawned inventory are compared
with vanilla's, then the level must load where it respawned. The client
also stops sending a movement packet beside each teleport acceptance
during the respawn: the 26.3 client sends the acceptance alone, and
vanilla's server kicks a second position in the same tick.

Fixes #566

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 03:11:16 +02:00
Ludovic Marie 943dd210d7 Dedicated server: encode each chunk section once, not once per player
Chunk packets took nearly all of the server's tick with players moving
about: every send re-encoded the column for that player (each section
unpacked and re-paletted with linear searches, light layers packed a
nibble at a time, heightmaps primed again) and unpacked all 9 x 24
sections around it to find which light layers exist. At 50 walking
bots that was ~85 % of the tick, 280-470 ms ticks against vanilla's
33 ms on the benchmark machine.

The encoder now keeps what a resident section gives the wire (its
bytes, whether it holds block entity blocks, whether it is all air) by
the section's address. Sections are immutable behind Arc and edits go
through Arc::make_mut, so an edited section moves to a new address,
and the cache's Weak keeps an old address from being reused: the same
address is the same unchanged section. Heightmaps are kept per column
the same way. Block entity tags are still read for every packet. The
bytes sent don't change.

Also: Paletted::from_values uses an index table instead of linear
palette searches (the same palette order and bits), the all-air check
reads the palette first and stops at the first block, uniform sections
skip unpacking, and light layers pack two blocks per byte in one pass.

On a busy Mac mini with 50 walking bots (`tick query`): about 400 ms
ticks with the faster palette and air checks alone, 14 ms with the
caches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:59:44 +02:00
rdbtCVS cd61e11b56 perf: intern gameplay projection strings and verify resource overrides 2026-10-17 01:42:34 +01:00
Ludovic Marie 1d3759bb77 Drop a redundant binding flagged by clippy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:40:33 +02:00
LookImEcho-Rick 3230b6b88d Fix mouse capture when world loading completes 2026-10-16 19:24:05 -05:00
rdbtCVS cf837118e9 perf: defer behaviour construction and test fresh resource loads 2026-10-17 01:18:24 +01:00
LookImEcho-Rick 5d614f1cf6 fix(rendering): correct selection outline on translucent blocks 2026-10-16 19:03:48 -05:00
rdbtCVS 78791b79ce Cache resolved block behaviours across launches 2026-10-17 01:03:21 +01:00
rdbtCVS a01d47f28f perf: share decoded block facts during client startup 2026-10-17 01:02:09 +01:00
Cosmic 1fc3f6724e Cancel block mining immediately when opening screens 2026-10-16 19:59:23 -04:00
Ludovic Marie f03990f663 Integrated server: control socket and chat read the server's side
With single player on its server thread, the window is the server's
client, and some of what it answered was its own empty side:

- `horizon-ctl save` and `save-all` returned ok without saving: the
  window's save skips worlds it is connected to. They now save on the
  server thread (`Integrated::call`).
- `horizon-ctl chat-log` read the window's local chat, which never
  showed what the server said (command feedback, joins). It reads the
  connection's chat, as the agent's chat query already did.
- The game's own messages (Open to LAN, screenshots...) went to that
  local chat, which is not drawn while connected: they now join the
  connection's chat.
- `state` names the world (the server thread's `LevelName`).
- The client follows its permission level (EntityEvent 24..28,
  LocalPlayer.setPermissionLevel), which the commands the chat offers
  and checks depend on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 01:45:15 +02:00
Ludovic Marie 2b1cd3e96e Name the launcher's real button in the incomplete-resources error
The launcher offers "Prepare again", not a Repair action.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 01:42:02 +02:00
Cosmic a024409a1a Show live connection packet rates and server brands in F3 2026-10-16 19:41:02 -04:00
Ludovic Marie 7e430564a6 Returning to the Overworld reuses its stronghold ring positions
Each dimension change builds the destination's generator again, and with
it a new structure state, so the 128 stronghold ring searches ran again on
every return to the Overworld (about 1.5 s on two workers) and held up the
first new chunks. The ring positions depend only on the shared generator
data, the seed and the dimension's generator definition, so the generator
data now keeps them by those (the last eight), and later generators for
the same world and dimension share them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 01:39:02 +02:00
Ludovic Marie 64a4c72ebd Merge pull request #574 from Online5277/fix/direct-connect-address
Remember Direct Connection server addresses
2026-10-17 01:37:47 +02:00
Ludovic Marie 69d03e546a Merge pull request #575 from Online5277/fix/quit-button-sound
Preserve quit button sounds when leaving a world
2026-10-17 01:37:43 +02:00
Cosmic ac2cc43aa6 Add mod management to Classic Options 2026-10-16 19:35:47 -04:00
Ludovic Marie dc42425c01 Integrated server: Open to LAN
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>
2026-10-17 01:33:34 +02:00