Commit Graph

3685 Commits

Author SHA1 Message Date
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 139c5abd1c Port the DataFixers of 1.19 to 1.20 for worlds from 1.18.2 on
The fixes from 3076 to 3459 (game event, cat, frog, painting, goat, goat
horn, filtered text, POI, blending, spawn egg, effect duration, archaeology,
double-sided signs, the 1.20 experiment and chunk statuses), the block
entities their schemas add, and block entities' remainders (a decorated
pot's shards stay next to its sherds). The sample world generator logs in
to 1.18.2 to 1.19.4 servers and gates the scene by version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:50:56 +02:00
Ludovic Marie 1b4c3dec6b Merge branch 'parity-base' into parity/blocks 2026-10-11 15:44:08 +02:00
Ludovic Marie 3ab461cffc Upgrade older worlds when Horizon opens them, as 26.3 does
Opening a world saved by an older version runs the file fixes, level.dat and
the DataFixers upgrades of every file instead of refusing it. The save
round-trip harness treats a lit campfire's cooking progress as a timer in the
vanilla views: Horizon saves it as loaded (stage 3 checks it exactly), and it
moves on by however many ticks each vanilla server ran before data get.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:44:02 +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 ef6499fb0e Merge branch 'parity-base' into parity/saves 2026-10-11 15:43:49 +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 c9a1e959ee Merge branch 'parity-base' into parity/saves 2026-10-11 15:26:57 +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 bf3de4ef05 WIP: saves parity work, paused while the harness tooling is sped up
Uncommitted changes the agent had in progress when it was stopped; may
not build or pass its harnesses yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:26:49 +02:00
Ludovic Marie e3a1cdce51 WIP: hud parity work, paused while the harness tooling is sped up
Uncommitted changes the agent had in progress when it was stopped; may
not build or pass its harnesses yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:26:47 +02:00
Ludovic Marie 45cb5850a9 WIP: blocks parity work, paused while the harness tooling is sped up
Uncommitted changes the agent had in progress when it was stopped; may
not build or pass its harnesses yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:26:46 +02:00
Ludovic Marie 504c4df027 Merge branch 'parity-base' into parity/loot-spawn
# Conflicts:
#	crates/horizon-client/src/mobs.rs
2026-10-11 14:17:15 +02:00
Ludovic Marie 45b8861a85 Accept vanilla's clockless time sync in the LAN bot test
MinecraftServer.forceGameTimeSynchronization broadcasts SetTime with no
clocks every 20 ticks, and it can reach a joining bot before
PlayerList.sendLevelInfo's full sync. Wait for a sync with clocks instead
of failing on the first packet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:16:34 +02:00
Ludovic Marie 6391ef0444 Merge branch 'parity-base' into parity/blocks
# Conflicts:
#	crates/horizon-client/src/mobs.rs
2026-10-11 14:16:18 +02:00
Ludovic Marie e6e7de7ebe Merge branch 'parity-base' into parity/saves 2026-10-11 14:12:55 +02:00
Ludovic Marie 4becbd860b Merge branch 'parity-base' into parity/hud 2026-10-11 14:12:44 +02:00
Ludovic Marie 6734879ff7 Pass rustfmt and clippy after merging the parity branches
Formats the overnight parity work, fixes the lints it introduced, and
updates the LAN bot test and mob AI probe for fields added on the other
side of the merges (the bot test also set a field that never existed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:11:51 +02:00
Ludovic Marie 6421e48c8f Merge commit 'a903cb4' into parity-base 2026-10-11 14:09:10 +02:00
Ludovic Marie 46e54c642f Merge commit 'e6ef8c5' into parity-base 2026-10-11 14:09:10 +02:00
Ludovic Marie 05bcc61446 Merge branch 'parity/multiplayer' into parity-base 2026-10-11 14:09:10 +02:00
Ludovic Marie c47a853e49 Merge branch 'parity/entity-ai' into parity-base 2026-10-11 14:09:10 +02:00
Ludovic Marie 3950c0ef7b Merge parity/assets into parity-base
# Conflicts:
#	crates/horizon-client/src/game.rs
2026-10-11 14:09:10 +02:00
Ludovic Marie 37ae66c8c7 Track shulker, bell, conduit, skull and pot animation state as vanilla ticks it
block_entity_anim ports ShulkerBoxBlockEntity.updateAnimation and its
open-count events, BellBlockEntity triggerEvent/tick with resonation,
ConduitBlockEntity.clientTick (shape check, hunting, rotation, nautilus
particles), SkullBlockEntity.animation and DecoratedPotBlockEntity wobbles,
and maps the state to the renderer's BlockAnim.

tools/test_block_entity_anim_parity.py runs the real vanilla block entities
on a stand-in client level (VanillaBlockEntityAnimOracle) against
examples/block_entity_anim_fixture: 172/172 cases, 12720 ticked steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:25:32 +02:00
Ludovic Marie 6e9f218a14 WIP: unfinished rendering-hud parity work, stopped for the night
Uncommitted changes the agent had in progress when it was stopped; may not
build or pass its harnesses yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:24:03 +02:00
Ludovic Marie 0a8fd9a78f WIP: unfinished loot-spawn parity work, stopped for the night
Uncommitted changes the agent had in progress when it was stopped; may not
build or pass its harnesses yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:24:03 +02:00
Ludovic Marie f78de6d9ae WIP: unfinished blocks parity work, stopped for the night
Uncommitted changes the agent had in progress when it was stopped; may not
build or pass its harnesses yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:24:03 +02:00
Ludovic Marie 68092c4c7f WIP: unfinished saves parity work, stopped for the night
Uncommitted changes the agent had in progress when it was stopped; may not
build or pass its harnesses yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:24:03 +02:00
Ludovic Marie 0410a222ea WIP: unfinished hud parity work, stopped for the night
Uncommitted changes the agent had in progress when it was stopped; may not
build or pass its harnesses yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:24:03 +02:00
Ludovic Marie 2012f8baad WIP: unfinished rendering-anim parity work, stopped for the night
Uncommitted changes the agent had in progress when it was stopped; may not
build or pass its harnesses yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:24:03 +02:00
Ludovic Marie fd23a8d682 Match vanilla atan2 tables, rotation constants, despawn checks and target search
Mth.atan2 builds its tables with StrictMath.asin (fdlibm, ported) and
HotSpot's cos; the controls multiply by the folded RAD_TO_DEG float
constant. Mob.checkDespawn runs before the tick and, in 26.3, persistent
mobs only reset their idle time near a player. NearestAttackableTargetGoal
always requires a line of sight and ignores mustReach when searching.
MeleeAttackGoal starts its canUse clock at game time 0. The harness now
records every random draw of the vanilla mobs with its caller, the random
state per tick, and starts each scenario at game time 1000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:23:16 +02:00
Ludovic Marie 5411923887 Join guests as PlayerList.placeNewPlayer does and send vanilla's command tree
Send the join packets in vanilla's order with the permission level entity
event, recipe book, server data, ticking state and post effects; announce
the newcomer only to the others; list players with every info action;
use vanilla's level key order and border warning time; sync the game time
every 20 ticks without clocks and the overworld clock only when it jumps.
Build the command tree from the commands report for the player's
permission level and server kind, with vanilla's suggestion providers
(VanillaCommandSuggestionsExporter), and answer command suggestions.
The tree matches what a vanilla integrated server sends node for node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:23:05 +02:00
Ludovic Marie 925e4d0f5f Merge remote-tracking branch 'desktop/parity-audio' into t3/achieve-full-parity 2026-10-10 22:22:41 +02:00
Ludovic Marie 1e0ad488bb Merge remote-tracking branch 'desktop/parity-input' into t3/achieve-full-parity 2026-10-10 22:21:34 +02:00
Ludovic Marie e6ef8c502b Check spawn placements and spawn predicates exactly as SpawnPlacements does
mobs::spawn_rules ports SpawnPlacements over a SpawnLevel trait the game's
MobWorld implements: the placement types with per-type isValidSpawn
(leaves, ice, magma for fire-immune types) and isValidEmptySpawnBlock with
each type's dangerous and immune blocks, and every registered predicate in
vanilla's draw order: the dimension's monster light test and block light
limit, thunder, peaceful, spawn reasons, guardians' sky from below water,
drowned, bats, ghasts, ocelots, slimes (surface chance and slime chunks),
strays under powder snow, striders, turtles, polar bears, tropical fish,
nautiluses, silverfish and endermites near players, patrols and the
spawnable-on tags.

Divergences fixed on the way: nether monsters ignored light, hoglins and
piglins had extra checks, slimes spawned outside slime chunks, ocelots and
ghasts skipped their odds, bats ignored the surface and their draw order,
and several predicates read the wrong blocks.

tools/test_spawn_rules_parity.py: 18,669 cases over 87 entity types match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:17:01 +02:00
Ludovic Marie 635acffda9 Draw every item through the resolved item model pipeline
The client now resolves stacks with horizon-assets' ItemModelResolver into
an ItemStackRenderState equivalent (item_render): baked cuboid layers with
their display and local transforms, tints and foil, and the special model
renderers (chests, shulker boxes, banners, heads, shields, tridents,
decorated pots, conduits, bells, books, copper golem statues) posed from
the entity model layers. GUI icons are submitted under the GuiItemAtlas
pose with ITEMS_3D/ITEMS_FLAT lighting, back faces culled and clipped to
the slot; dropped items follow ItemEntityRenderer (bounding box hover,
spin and seeded cluster copies); item frames, first-person and mob,
player and armour stand hands, worn skulls and head items submit the
same state in the world.

The client atlas also runs the atlas sprite sources (directory, single,
filter, unstitch, paletted_permutations), so armour trim sprites exist.
The ad-hoc icon, held-banner, shield, potion-layer and glint paths are
gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:16:52 +02:00
Ludovic Marie f77a22177a Click recipe book buttons at forUI volume and test the mixer
Recipe book widgets play SimpleSoundInstance.forUI(UI_BUTTON_CLICK, 1.0F),
whose volume is 0.25. Unit tests cover the mixer distance gain and the
stopped/looping source states.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:13:40 +02:00
Ludovic Marie 17ac24f4db Drive toggle sprint/sneak as vanilla's key handlers do and compare
ToggleKeys holds the sneak, sprint, attack and use ToggleKeyMappings with
the dispatch of KeyboardHandler.keyPress (releases always reach them;
presses and SDL key repeats only without a screen), MouseHandler.onButton,
Gui.setScreen (releaseAll / restoreToggleStatesOnScreenClosed) and
LocalPlayer.respawn (resetToggleKeys, which Horizon lacked). Presses behind
a screen no longer flip a toggled key. tools/test_toggle_keys_parity.py
drives the real Options mappings through the real static KeyMapping
functions (8,000 sequences).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:12:23 +02:00
Ludovic Marie 1357e2f01b Choose situational music exactly as Minecraft.getSituationalMusic does
Situation captures the screen music, the menu without a player, End boss
music, creative abilities and underwater selection and the music volume;
the harness calls the real getSituationalMusic/getMusicVolume with a real
camera attribute probe for every dimension and biome.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:10:06 +02:00
Ludovic Marie 538347007a Add auto-jump and compare it with LocalPlayer.updateAutoJump
Horizon had the Auto-Jump option but never jumped. MotionWorld::move_self
now runs LocalPlayer.updateAutoJump after the player's own move (behind
canAutoJump: option, autoJumpTime, ground, shift, input, block jump
factor), the next aiStep presses jump for one tick (input.makeJump) without
toggling creative flight, and the game feeds the option each tick.
tools/test_auto_jump_parity.py runs the real updateAutoJump on a LocalPlayer
shell in an independently built copy of the resident test scene with real
block states (10,568 cases, 1,200 jumps).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:04:04 +02:00
Ludovic Marie b93f72c0da Play bubble column inside sounds as BubbleColumnAmbientSoundHandler does
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:03:51 +02:00
Ludovic Marie 8ef3195457 Merge remote-tracking branch 'desktop/parity-rendering' into t3/achieve-full-parity 2026-10-10 22:03:24 +02:00