Commit Graph

13 Commits

Author SHA1 Message Date
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 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 92209ddeee Trading on the dedicated server, compared with vanilla's
test_dedicated_server_parity summons a librarian beside the spawn and the
vanilla protocol client right-clicks it: the OpenScreen packet (title as
Entity.getDisplayName, UUIDs left out) and the MerchantOffers packet must
match vanilla's server. Villagers keep Xp, LastRestock and RestocksToday
before their offers are made (vanilla's null offers).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 23:01:02 +02:00
Ludovic Marie 7c8afc8a34 Merge branch 'parity-base' into parity/server-leftovers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 05:44:19 +02:00
Ludovic Marie 0a2601c33a Send recipes, advancements and command replies to players as vanilla does
- ClientboundUpdateRecipesPacket at join: the recipe property sets and the
  stonecutter's recipes, from the data pack (lan/recipes.rs).
- On a player's first tick the minecraft:tick criteria are met: the recipes
  their advancements grant go out in ClientboundRecipeBookAddPacket, then
  ClientboundUpdateAdvancementsPacket with what the player may see
  (lan/advancements.rs).
- Command replies reach remote players as the components vanilla sends:
  Text keeps the Component it was built from (literal, translatable,
  siblings, style), sendFailure wraps the message as vanilla does, and the
  NBT wraps the elements of mixed lists.

The dedicated-server harness drops its known gaps: it compares these
packets (sorted where vanilla's hash maps order them per run) and the
replies to three failing commands, keeps only the first set_time among the
joining packets and turns random ticks off in the generated world.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 05:43:51 +02:00
Ludovic Marie 7322bba2b5 dedicated_server: read the game time as the console prints it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 03:51:40 +02:00
Ludovic Marie 71e677ed6a dedicated_server: settle the generated world in game ticks, without random ticks
The world was saved 20 wall-clock seconds after force-loading the area, so
on a busy machine chunks were still generating or their fluids flowing,
and random ticks changed blocks while the client was being sent its
chunks: which chunks differed varied from run to run. Wait until every
force-loaded chunk is loaded and 600 game ticks have passed, with
random_tick_speed 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 03:40:50 +02:00
Ludovic Marie de3a285cb3 Headless Horizon client joining a vanilla dedicated server, checked by the harness
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 01:07:19 +02:00
Ludovic Marie 6f84b9ae94 Harness names differing chunks; spawner update tags without keepPacked
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 01:02:14 +02:00
Ludovic Marie 5f5b6119d2 Spawner update tags in chunk packets; harness lists recipes and advancements as known gaps
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 00:57:10 +02:00
Ludovic Marie 4d62899a10 Harness: force-load the spawn area so both servers serve full chunks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 00:52:35 +02:00
Ludovic Marie 7ede56b596 Dedicated server: vanilla console lines, player chat, /list, legacy ping, chunk tracking, heightmaps and light layers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 00:32:29 +02:00
Ludovic Marie 8d16a937c5 Dedicated server: load the spawn area; vanilla-codec client harness
VanillaProtocolClient joins a server with vanilla's own codecs;
test_dedicated_server_parity.py compares a vanilla and a Horizon dedicated
server serving the same world.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 00:18:01 +02:00