Commit Graph

758 Commits

Author SHA1 Message Date
Ludovic Marie e2b3f7b4e9 Keep unsimulated entities' UUIDs across saves and save player equipment as vanilla
save_entities forgot the UUID and compound of entities Horizon keeps but
does not simulate, so the save on quit gave them new UUIDs. The player's
equipment is written as LivingEntity does: omitted when empty, where
PlayerEquipment.isEmpty also counts the selected hotbar item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 13:26:18 +02:00
Ludovic Marie feb043fda6 Merge parity/blocks into parity/hud
Block loot keeps one random-sequence path: the blocks side's block_loot
with the generic loot evaluator, and /loot uses the shared loot_sequence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 19:02:13 +02:00
Ludovic Marie 7d35a25906 Format and lint the command parity changes
Clippy and rustfmt clean, and the scoreboard test now expects vanilla's
removeObjective, which keeps holders tracked without scores.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 18:00:32 +02:00
Ludovic Marie 99057953e0 Mark dispensers as matching vanilla in the parity table
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 17:51:49 +02:00
Ludovic Marie 2e775aff2f Merge parity-base into parity/hud 2026-10-11 17:51:39 +02:00
Ludovic Marie d0815052cd Merge branch 'parity-base' into parity/blocks 2026-10-11 17:51:37 +02:00
Ludovic Marie 168bc1d0a3 Merge branch 'parity/loot-spawn' into parity-base 2026-10-11 17:36:20 +02:00
Ludovic Marie 2eb688cc6a Decrypt bytes already read when a connection enables encryption
Encrypted bytes that arrived in the same read as the last plain packet
stayed in the buffer undecrypted, and the connection then waited forever
for a frame it could not parse. The loopback test hit this under load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 17:36:20 +02:00
Ludovic Marie a919e44050 Run /locate biome and poi and /place feature, jigsaw and structure as vanilla
/locate biome samples the biome source like BiomeSource.findClosestBiome3d,
/locate poi scans loaded chunks for PoiTypes block states within 256 blocks,
/place feature places the configured feature with the level random,
/place jigsaw assembles pieces with JigsawPlacement.addPieces and places
them into the level, and unknown structures or pools report vanilla's
errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 17:35:55 +02:00
Ludovic Marie 6ed726e935 Merge branch 'parity-base' into parity/loot-spawn 2026-10-11 17:26:12 +02:00
Ludovic Marie d46fa60400 Run /compute as vanilla's ComputeCommand
Context int and float providers (inline or registered) evaluate with
Java's arithmetic, exceptions and rounding, in the default, block or
entity loot context; their codecs report missing fields as
DataFixerUpper does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 17:24:18 +02:00
Ludovic Marie 17b1bcf2ce Destroy blocks for /setblock and /fill destroy as Level.destroyBlock does
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 17:11:05 +02:00
Ludovic Marie debc6e124c Award tick, inventory and recipe advancements and draw block drops as vanilla
PlayerTrigger.TICK fires every tick and InventoryChangeTrigger as the
inventory changes; /recipe counts recipe book displays and fires
RecipeUnlockedTrigger; block drops draw from their loot table's random
sequence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 17:02:09 +02:00
Ludovic Marie ae3f129c8e Format the dispenser parity work
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:54:06 +02:00
Ludovic Marie 54a92f23f0 Give every block update oracle level a chunk generator
Bone meal and saplings reach for getChunkSource().getGenerator(); the
shared oracle level now answers it, as the dispenser oracle did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:52:18 +02:00
Ludovic Marie 753b5654b1 Keep errors inside forked execute chains silent, as vanilla
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:51:07 +02:00
Ludovic Marie a47f1ec58b Dispense mobs with their jockeys as vanilla's spawn eggs do
A dispensed spawn egg's mob gets the riders finalizeSpawn adds (chicken
jockeys, spider jockeys, strider jockeys). The harness leaves which mob
comes out a baby and rides to the spawning port's finalization draws, as
it already does for the level random of spawning cases. Cases no longer
grow plants out of a dispenser or build a door from mismatched halves,
and the oracle runs every case three times so an unseeded value is
marked even when two runs happen to agree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:50:20 +02:00
Ludovic Marie 00371a7f35 Run /test as vanilla does in a world without test instances
Model TestCommand's release tree (ResourceSelectorArgument patterns
included) and its finder, locate, pos, stop and clear outcomes when no
test instance block exists. Compare /help's gamerule alternatives as a
set: GameRuleCommand registers them in identity-hash order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:47:42 +02:00
Ludovic Marie 3ba0204bc0 Merge branch 'parity-base' into parity/blocks 2026-10-11 16:44:43 +02:00
Ludovic Marie 38059ab9f9 Merge branch 'parity-base' into parity/hud 2026-10-11 16:43:21 +02:00
Ludovic Marie d061bdf2fb Share harness passes between worktrees and cap harnesses machine-wide
A pass is keyed by the content of the harness's dependencies, so it is
also valid in any worktree with the same files. Passes are published to
parity-shared/ beside the shared vanilla data, and a worktree adopts one
whose key matches its own files instead of running the harness: an
agent's gate only runs what its own changes affect, instead of the whole
suite from scratch. Every runner on the machine also shares
PARITY_MACHINE_JOBS slots, so several agents' gates can't overload it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:42:52 +02:00
Ludovic Marie d7e4a5a275 List command usages in vanilla's registration order and run the release tree
Brigadier keeps children in registration order and /help prints them
that way; tools/generate_command_order.py records vanilla's order where
Horizon's tree differs. The game now runs the release integrated
server's tree; HORIZON_DEV_COMMANDS restores the development commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:41:43 +02:00
Ludovic Marie 8490e19ec0 Resolve nbt text components, other dimensions and vanilla's own data as vanilla
/tellraw resolves nbt components; execute in another dimension sees its
chunks unloaded; the built-in pack's predicates load; holders stay
tracked after their objective is removed; new worlds use the offline
profile id of the player.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:34:17 +02:00
Ludovic Marie 6605e6cdf1 Run the dispenser fixture in the oracle's plains light and level
The fixture's chunks are plains (empty chunks read as badlands, which has
no bone meal flowers) and carry the case's sky and block light, as the
oracle level does, so grass bone meal places flowers and crops check
their light like vanilla's. The oracle's client sounds include the lava
fizz (1501). Cases build two-block plants whole: a lone lower half is not
a world vanilla makes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:32:28 +02:00
Ludovic Marie 2faf5520b3 Match vanilla /spreadplayers, /datapack, /reload, function tags and dialog codecs
/spreadplayers follows SpreadPlayersCommand (safe positions, failure
distance, float centre); /datapack models the built-in, feature and
world packs with their chat links; unknown function tags are empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:22:06 +02:00
Ludovic Marie 7994c1e8c5 Count natural spawning among the entity checks that match vanilla
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:19:49 +02:00
Ludovic Marie 6949ca4455 Target rarer natural spawns in the parity harness
Desert, snowy, swamp and jungle nights, lush, sulfur and dripstone caves,
warm and frozen oceans, crimson forests and slime chunks. A cube mob grown
by finalizeSpawn takes its constructor's head rotation from the entity's
unseeded random (AbstractCubeMob.onSyncedDataUpdated), so that yaw alone is
not compared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:14:22 +02:00
Ludovic Marie 36209e7827 Place dispensed shulker boxes only where DirectionalPlaceContext can
A dispenser places a shulker box in the block in front or nowhere, and
only when that block's canBeReplaced accepts it (a snow layer only when
it is a single layer).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:10:30 +02:00
Ludovic Marie b2812c55be Choose natural spawns exactly as vanilla's NaturalSpawner does
tools/test_natural_spawn_parity.py compares whole chunk spawn passes,
spawnCategoryForPosition from chosen sites and chunk generation packs
against vanilla's NaturalSpawner on generated box worlds.

Divergences fixed on the way: the reduced water ambient tag is
reduce_water_ambient_spawns, and the room check uses each type's spawn
dimensions scale (4 for slimes and magma cubes, 2 for sulfur cubes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:10:12 +02:00
Ludovic Marie 8eca39aff1 Equip, saddle and light from dispensers as vanilla does
Villagers, piglins, piglin brutes, allays, dolphins, foxes and pandas can
pick up loot from construction (their constructors call
setCanPickUpLoot), so they take dispensed equipment without spawn
finalization. Nautilus saddles play item.nautilus_saddle_equip. The
oracle level is the overworld, so fire in an obsidian frame lights a
portal there too, and it answers getEntity(id) and level-wide entity
queries, which leash cutting needs. Unseeded item motion is compared
within its full spread (item motion plus a shearing sheep's push).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:07:06 +02:00
Ludovic Marie b5d84b138d Match vanilla /clear predicates, /particle results, block entity NBT and /fillbiome checks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:06:17 +02:00
Ludovic Marie c80edcdbf4 Draw /loot from each table's random sequence, as vanilla
LootTable.getRandomItems uses the table's random_sequence, so /loot
results are deterministic per world seed; inline loot tables and tool
components now work too. The oracle ticks its player like the network
listener does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:59:56 +02:00
Ludovic Marie bcfa2f6974 Retry fresh only when a harness that passed fails while reusing oracle results
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:56:45 +02:00
Ludovic Marie 894113d7f4 Build golems and withers from dispensers as vanilla does
Golems and the wither come from EntityType.create (no spawn finalization,
no level random), after clearPatternBlocks sets every pattern cell to air
with flags 2 and a destroy event, and updatePatternBlocks follows. A
dispensed pumpkin that completes a golem skips setBlock's neighbour
updates as vanilla's does, and pumpkins and skulls post block_place.
Dispensed skulls face RotationSegment.convertToSegment(facing). Destroy
events for air play no break sound. The dispenser fixture plays on normal
difficulty like the oracle level.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:53:37 +02:00
Ludovic Marie 2ea1c273dd Run /item modify, /summon stacks and generic attributes as vanilla
Inline and registered item modifiers now apply (26.3's type-dispatched
functions, set_lore, set_custom_data, set_components, toggle_tooltips,
filtered), counting every set slot like CountingModifier. Item stacks
keep components Horizon does not model, display names follow
ItemStack.getDisplayName, /data prints compounds in CompoundTag's
HashMap order, summoned passengers snap to the position, and living
entities other than the player get vanilla attribute maps (waypoint
transmit range included, tracked as ServerWaypointManager does).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:52:59 +02:00
Ludovic Marie a598255898 Add the natural spawn oracle and fixture
VanillaNaturalSpawnOracle runs NaturalSpawner (createState, the filtered
categories, spawnForChunk's loop, spawnCategoryForPosition and
spawnMobsForChunkGeneration) on a stand-in level built from boxes of blocks,
light and biomes with structure pieces, entities, players, the world spawn
and unloaded chunks; natural_spawn_fixture runs mobs::spawn_selection on the
same world.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:52:12 +02:00
Ludovic Marie 1b4c3dec6b Merge branch 'parity-base' into parity/blocks 2026-10-11 15:44:08 +02:00
Ludovic Marie 484bbb5ee8 Merge branch 'parity-base' into parity/loot-spawn 2026-10-11 15:43:57 +02:00
Ludovic Marie e019d361d9 WIP: natural spawn oracle and collision lookup (harness in progress)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:43:57 +02:00
Ludovic Marie c2b7dad0e4 Merge branch 'parity-base' into parity/hud 2026-10-11 15:43:47 +02:00
Ludovic Marie 13759ef16b Reuse unchanged vanilla oracle runs, and keep test games silent
tools/parity_shim.py stands in for java and javac in harness runs: it
records each oracle run's outputs and the content of every file under the
paths its arguments name, and replays the run while those are unchanged.
After a Rust-only change a harness only pays for its Rust side
(block_update 53 s -> 5 s). A harness that fails while reusing oracle
results is rerun fresh, and stops reusing them if that passes; --all and
--fresh never reuse them.

Harness probes built in the dev profile are optimised (overflow checks
and debug assertions kept), and the chunk generation harness runs its
vanilla and Horizon sides concurrently.

HORIZON_NO_AUDIO keeps the game off the speakers; tools/parity.py sets it,
since the save round-trip harness launches the game on a virtual screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:43:26 +02:00
Ludovic Marie c626f696f5 Set dispensed mobs down as EntityType.getYOffset does
Only the collision shapes overlapping the spawn block stop the fall, so a
wide mob beside the dispenser no longer lands a block high. Spawn egg
cases compare that the new mob speaks and where, not which of its voices
its own unseeded random picked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:41:00 +02:00
Ludovic Marie a21d268a41 Spawn naturally through a NaturalSpawner port shared by the game
mobs::spawn_selection ports NaturalSpawner over a NaturalLevel trait: the
spawn state (category counts, spawn potential charges, local caps), the
filtered categories, spawnForChunk, spawnCategoryForPosition with mobsAt,
isValidSpawnPostitionForType and isValidPositionForMob, and
spawnMobsForChunkGeneration. The game's spawning goes through it. Biomes
now load their spawn costs and creature_world_gen_spawn_probability.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:40:15 +02:00
Ludovic Marie f9fcb004a5 Dispense chest boats and command block minecarts as vanilla does
BoatDispenseItemBehavior spawns the chest boat or chest raft itself: boats
now carry ChestBoat's 27-slot chest, drawn with its model, saved with its
Items, opened by sneaking, spilt when broken. MinecartDispenseItemBehavior
spawns command block minecarts (an empty command). The dispenser harness
now draws fronts per item (fire, portal frames, anchors, crops, copper,
hives, golem and wither builds), every boat wood, more equipment, spawn
eggs, sulfur cube swallowables and leashed targets, over 6000 cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:38:13 +02:00
Ludovic Marie a5aaa53ab7 Light fires, portals, candles and anchors from dispensers as vanilla does
Flint and steel uses BaseFireBlock.canBePlacedAt and getState (a portal
frame draws the level random for vertical dispensers), posts block_place
and block_change, and lights only what CampfireBlock, CandleBlock and
CandleCakeBlock.canLight accept. Fire placed inside an empty obsidian
frame now lights the portal (BaseFireBlock.onPlace). Glowstone posts the
anchor's block_change. Shears cut leads (shearOffAllLeashConnections) and
empty a sulfur cube. Dropped leads draw motion from the item's own
random, not the level's. The oracle gives bone meal a chunk generator so
sapling, grass and moss cases are compared instead of erroring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:31:35 +02:00
Ludovic Marie 01f492c939 Select, tag and summon entities Horizon does not simulate, as vanilla
Markers, displays and other unsimulated entity types are now kept as
their saved data at a position, so selectors, /tag, /kill, /tp and
/data reach them. Widen the command execution corpus to every command
the integrated server registers, and keep the oracle's terrain tickets
out of /forceload's view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:31:12 +02:00
Ludovic Marie 888ce5a3ff Merge branch 'parity-base' into parity/loot-spawn 2026-10-11 15:27:03 +02:00
Ludovic Marie 89b712b5a8 Merge branch 'parity-base' into parity/hud 2026-10-11 15:26:52 +02:00
Ludovic Marie 51b6b0b65e Merge branch 'parity-base' into parity/blocks 2026-10-11 15:26:48 +02:00
Ludovic Marie abee1f165b Let the gate pass with harnesses that already fail on the integration branch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:05:57 +02:00