Commit Graph

649 Commits

Author SHA1 Message Date
Ludovic Marie 2e3063d821 Merge branch 'parity/mobs-b' into parity-base
# Conflicts:
#	crates/horizon-client/examples/entity_anim_fixture.rs
#	crates/horizon-client/examples/mob_ai_probe.rs
#	crates/horizon-client/src/game/creatures.rs
#	crates/horizon-client/src/mobs.rs
#	crates/horizon-client/src/mobs/ai.rs
#	mods/horizon/src/test/java/dev/horizonlab/parity/VanillaMobAiOracle.java
#	tools/test_mob_ai_parity.py
2026-10-12 17:54:20 +02:00
Ludovic Marie f02c47d289 Merge branch 'parity/mobs-a' into parity-base 2026-10-12 17:50:53 +02:00
Ludovic Marie 14bff2518f Merge branch 'parity/raids' into parity-base
# Conflicts:
#	README.md
#	docs/rust-parity.md
2026-10-12 17:50:53 +02:00
Ludovic Marie c195cd3239 Merge branch 'parity/tablist-border' into parity-base
# Conflicts:
#	README.md
#	crates/horizon-client/src/lib.rs
#	docs/rust-parity.md
2026-10-12 17:50:31 +02:00
Ludovic Marie 69b191b1f4 Merge branch 'parity/loom-crafter' into parity-base
# Conflicts:
#	README.md
#	crates/horizon-client/src/game/dispense_fixture.rs
#	docs/rust-parity.md
#	mods/horizon/src/test/java/dev/horizonlab/parity/VanillaDispenserOracle.java
2026-10-12 17:48:44 +02:00
Ludovic Marie b6fa612bee Merge branches 'parity/tooling', 'parity/score-subtitles' and 'parity/block-followups' into parity-base 2026-10-12 17:47:58 +02:00
Ludovic Marie 9c465af186 WIP: unfinished spawn-gear parity work, stopped by Ludovic
Uncommitted changes the agent had in progress when it was stopped on
2026-10-12; may not build or pass its harnesses yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:46:50 +02:00
Ludovic Marie 5ea641a7c2 WIP: unfinished villager-social parity work, stopped by Ludovic
Uncommitted changes the agent had in progress when it was stopped on
2026-10-12; may not build or pass its harnesses yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:46:50 +02:00
Ludovic Marie edd598cc68 WIP: unfinished warden-sculk parity work, stopped by Ludovic
Uncommitted changes the agent had in progress when it was stopped on
2026-10-12; may not build or pass its harnesses yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:46:50 +02:00
Ludovic Marie c90cd5f072 Match vanilla llama caravans, trader llamas, breeding and wolves
A lead gives its mob a home at the holder (PathfinderMob.whenLeashedTo)
and every random position helper honours homes (generateRandomPos-
TowardDirection's lean back and GoalUtils.isRestricted), as the happy
ghast's float area now does too. LlamaFollowCaravanGoal keeps 2.1F, a
llama's baby and the breeding experience are drawn from the parent's
random, wolves run from llamas by strength (WolfAvoidEntityGoal), a
growing mob refits its box (fudgePositionAfterSizeChange) and a happy
ghast's new controls want nothing. Scenarios can lead mobs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:45:09 +02:00
Ludovic Marie ca1bc52a49 Stop the jukebox's song and the beacon as their block entities go
LevelChunk.removeBlockEntity calls setRemoved: a jukebox reports its song
stopping (the jukebox_stop_play game event and level event 1011) and a
beacon plays its deactivation, whatever the flags. A record popped from a
replaced jukebox stops a playing song first and updates the neighbours as
JukeboxBlockEntity.onSongChanged does (a redstone wire beside it can pop).
The block update oracle removes block entities the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:44:54 +02:00
Ludovic Marie 63f628762f Tick creaking hearts as vanilla and compare them with the oracle
mobs::creaking_heart is CreakingHeartBlockEntity: the ticker drawn from
the level random, the state following the night and the logs, the
protector spawned with SpawnUtil.trySpawnMob (five tries within 16
blocks, on top of a collider, then EntityType.create's yaw and
Mob.finalizeSpawn's follow range bonus), its sounds, letting it go by
day, beyond 34 blocks or with a player stuck in it, and when a player
hurts it the trails and the resin spread over the logs. The game ticks
its hearts through it, and its level random now carries on between
ticks.

The mob AI harness gains hearts: the oracle places them when a scenario
starts, ticks block entities after the mobs, seeds the creakings the
level creates and adds them to the scenario, prints each heart's state
and block entity, and lets the player hit a mob (hurt T I). Five heart
scenarios (night, day, uprooted, no player near, hit twice) match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:40:47 +02:00
Ludovic Marie b5c0bf7859 Draw the loom and crafter screens as the vanilla client does
LoomScreen.extractBackground (slot icons, scroller, pattern buttons
with their swatches and tooltip, the result banner or the six-layer
error) and CrafterScreen's background, disabled slots and redstone
arrow become screen_layout calls the game paints. A new harness runs
vanilla's screens on stand-in menus and compares 1,600 call lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:38:25 +02:00
Ludovic Marie 225c12f4cc Move subtitles into the HUD overlays and save scoreboards end to end
The subtitle overlay now lays out GuiDraw calls in hud_overlays and the
game paints them like the other overlays. Hover events that show an entity
save its UUID as an int array, as UUIDUtil.CODEC does. The save round trip
builds a vanilla scoreboard with every saved field (objectives, number
formats, display slots, locked and displayed scores, teams with every
option) and requires Horizon to save scoreboard.dat as vanilla did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:35:05 +02:00
Ludovic Marie 01db93a987 Port server.properties, eula.txt and the server user lists
DedicatedServerProperties with every key, default, parser and serializer,
java.util.Properties load/store, Eula and the four StoredUserList files,
checked against the pinned server JAR by test_server_files_parity.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:34:57 +02:00
Ludovic Marie 515d15d36f Merge the integration branch into parity/tablist-border
Keep the integration branch's StringSplitter port and HUD overlays: the tab
list now emits hud_layout::GuiDraw calls and wraps with its split_lines, and
the vignette's border warning comes from WorldBorder::warning_strength
through hud_overlays::border_warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:25:13 +02:00
Ludovic Marie a425de4c1c Merge the integration branch: villager brain, mob AI fixes and HUD overlays
The raid bars now draw through hud_overlays. Villagers' raid field is
what getRaidAt finds where they stand, with lost raids and the wave flag
kept apart, so the brain's SetRaidStatus, ResetRaidStatus (which resets on
a lost raid), ReactToBell and raid packages read vanilla's conditions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:23:59 +02:00
Ludovic Marie e664d2f7c4 Merge origin/t3/achieve-full-parity into parity/block-followups
Explosion drops keep their random sequences and the pot's dynamic drops;
/setblock destroy and /fill destroy run Level.destroyBlock through the
behaviour library, so the block entity spills as vanilla's does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:19:39 +02:00
Ludovic Marie e723c8ad6c Merge origin/t3/achieve-full-parity into parity/score-subtitles
Mobs push through the new pushEntities with the teams' collision rules;
lang keeps the integration branch's deprecated.json handling; the
scoreboard keeps this branch's vanilla hash orders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:19:13 +02:00
Ludovic Marie 2edae5746a Merge origin/t3/achieve-full-parity into parity/mobs-b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:18:39 +02:00
Ludovic Marie 5dd2840cee Merge remote-tracking branch 'origin/t3/achieve-full-parity' into parity/warden-sculk
# Conflicts:
#	crates/horizon-client/src/game.rs
#	crates/horizon-client/src/game/creatures.rs
2026-10-12 17:18:11 +02:00
Ludovic Marie a5eb241c32 Merge remote-tracking branch 'origin/t3/achieve-full-parity' into parity/loom-crafter
# Conflicts:
#	crates/horizon-client/src/game/commands/world_cmds.rs
2026-10-12 17:15:59 +02:00
Ludovic Marie 8393b8de0f Match vanilla breeding sniffers and tempted happy ghasts
Mobs set each other's brain memories within the tick (the breed target
and lockGazeAndWalkToEachOther), the partner rests and forgets at the
birth, and an animal in love draws its heart particle randoms. The adult
happy ghast's TemptGoal.ForNonPathfinders ticks every other tick and
follows creative players. The mob AI scenarios can give the player an
item and a mob love, taming, an age or a llama strength.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:15:34 +02:00
Ludovic Marie b56b4c3cea Bring the copper golem into the game and build it and shear it as vanilla does
The copper golem code (its goals, chest transport, weathering, statues and
interactions) was in the tree but not compiled; it is now a species with
its model, keyframe animations, sounds and game hooks. Its antenna flower
sits in the saddle slot as vanilla's EQUIPMENT_SLOT_ANTENNA, sheared by
players and dispensers with the unequip event and the 1.5-up drop, and
dropped with the carried stack as preserved equipment. A pumpkin on a
copper block builds it after the snow and iron golem patterns: both blocks
clear, the block becomes the matching copper chest (CopperChestBlock
getFromCopperBlock with the least oxidized of connected chests), and the
golem takes the block's weathering and plays its spawn sound. Weathering
draws from the level random, the statue pose from the golem's own.

The dispenser harness now builds copper golems and shears and equips them:
6000/6000 cases match.

Block.popResource of tall flowers and flower beds and the composter's
bone meal pop when the behaviour asks, as vanilla does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:14:20 +02:00
Ludovic Marie 8ba728287f Order the recipe book's buttons as the vanilla client does
ClientRecipeBook keeps the displays it was sent in a HashMap of display
ids, whose iteration order (buckets, then arrival) orders the
collections; the game now keeps such a client book (on the verified
Java HashMap port) synced with the server book, with display ids
numbered as RecipeManager does. A new harness runs the client's
ClientRecipeBook, RecipeCollection selection and the tab and page logic
of RecipeBookComponent over 1,200 cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:14:14 +02:00
Ludovic Marie 59a966a9e3 Compare breezes and creakings with vanilla in the mob AI harness
Eight scenarios: a breeze alone and fighting a player near, inside and
beyond its jump circle; a creaking alone, watched, unwatched, and woken
then hunting once the player turns away (a new player turn= option).
The oracle now faces the player +z with its head too (it kept a random
head yaw from its creation, which the breeze's jump target reads).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:14:07 +02:00
Ludovic Marie bbae62fc4b Render subtitles exactly as vanilla's SubtitleOverlay
The overlay listens to the sound engine from the frame that renders it with
Show Subtitles on until one renders with it off (keeping its captions),
forgets plays as it renders, picks the latest play in range (the first of
full ties), fades in float arithmetic, lays the boxes out in integers under
the pose translation and takes its background from the text background
opacity options. Translations now apply the game's deprecated.json renames,
as ClientLanguage does ("Chick hurts"). tools/test_subtitle_parity.py runs
vanilla's SubtitleOverlay on 1500 scripted cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:07:47 +02:00
Ludovic Marie 621fca874c Keep the player's recipe book as vanilla's ServerRecipeBook does
The known and highlighted recipes, the book settings and the saved
recipeBook compound now live in one place (recipe_book::Settings with
a RecipeIndex of learnability and display counts): advancement rewards,
/recipe give and take (counting displays, never special recipes) and
crafting a recipe award through it, and loading drops unknown recipes
instead of rebuilding the set from done advancements. A new harness
compares 1,500 operation sequences with vanilla's ServerRecipeBook and
its codec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:02:53 +02:00
Ludovic Marie 2f232d955c Charge sculk catalysts when the killing blow lands
Mobs die (LivingEntity.die: the death event, catalysts, loot and
experience) when they are killed, not when their death animation ends.
Catalysts take a death in the dispatcher's order (nearest by exact
distance, then visiting order); experience orbs draw their merge id from
the level random and their motion from their own. The sculk harness
gains catalyst scenarios: kills by the player near catalysts over
random terrain, with blooms, charge cursors and the sculk they spread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:01:59 +02:00
Ludovic Marie acf4df3a90 Place recipe book recipes as vanilla's ServerPlaceRecipe does
ServerPlaceRecipe and StackedContents' RecipePicker run on the menu
engine (horizon_client::menu::place) for the inventory, crafting table
and furnaces: testClearGrid, clearGrid with placeItemBackInInventory,
the biggest craftable stack, clamping to stack sizes and moveItemToGrid.
A new harness compares 6,000 placements with vanilla; vanilla's item
order follows identity hash codes, so the oracle hands its order to the
Rust side. The game's recipe book now places through the engine, and
its craftable filter uses the same counts and placement ingredients.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:51:38 +02:00
Ludovic Marie 4490ff75fc Spill block entity contents when their block is replaced, as vanilla does
LevelChunk.setBlockState now runs BlockEntity.preRemoveSideEffects and
removes the block entity when a block with one is replaced by another
block (copper chests and copper golem statues keep theirs across
weathering; UPDATE_SKIP_BLOCK_ENTITY_SIDEEFFECTS skips the side effects).
Containers spill every slot through Containers.dropItemStack (spot and
pieces of 10 to 30 with triangular motions from the level random, empty
slots still drawing their spot), jukeboxes pop their record, lecterns
their book; shulker boxes keep their contents for the dropped box.
Campfires, decorated pots, chiseled bookshelves and shelves, which Horizon
keeps as loaded, spill too.

Block.dropResources now draws its loot and pop spots when the behaviour
calls it, not after it returns, and spawnAfterBreak awards ore, sculk and
spawner experience. Item entities and orbs the behaviour makes are added
before it returns to the game, in the same tick. Player mining follows
ServerPlayerGameMode.destroyBlock's order (removal and spill, tool wear,
then the drops); explosions let the removal spill the contents.
ExperienceOrb.award draws the merge id from the level random and moves
the orb with its own random. Decorated pots copy their decorations and
drop their sherds when cracked (loot tables' dynamic entries).

The block update oracle replays preRemoveSideEffects too, and the new
block removal harness (tools/test_block_removal_parity.py) compares
setBlock/destroyBlock/removeBlock on every block entity holder with
contents against vanilla: 2000/2000 cases match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:49:20 +02:00
Ludovic Marie e6aa9f71b0 Merge branch 'parity/rendering-be' into parity-base 2026-10-12 16:43:52 +02:00
Ludovic Marie 93c3de5d61 Merge branch 'parity/hud' into parity-base 2026-10-12 16:43:50 +02:00
Ludovic Marie 095991b946 Merge branch 'parity/rendering-hud' into parity-base 2026-10-12 16:43:49 +02:00
Ludovic Marie cfb19e238f Merge branch 'parity/rendering-anim' into parity-base 2026-10-12 16:43:49 +02:00
Ludovic Marie ec6c2c596f Merge branch 'parity/entity-ai' into parity-base 2026-10-12 16:43:48 +02:00
Ludovic Marie cb19f5e7d6 Make the datafix harness take 40 seconds instead of 25 minutes
The oracle spent 58 of every world's 62 seconds waiting for the idle
threads of the game's IO pool to time out; it now exits once its outputs are
written (same outputs on all 22 worlds). The harness runs in 6 shards, keeps
the vanilla outputs so the oracle's results are reused, and declares its Rust
scope (datafix, NBT, region files, compression and horizon-core positions):
other horizon-world changes no longer rerun it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:41:51 +02:00
Ludovic Marie 5352b59358 Tick the sniffer's and the ghastling's brains
The level random is passed down to the mob AI step as the integration
branch does, the brain runs in customServerAiStep's place, and the mob AI
probe builds the brain after seeding the mob and prints its activities and
memories. The oracle seeds every GateBehavior's shuffle with the mob's seed
(the same change the entity-ai branch makes) so RunOne picks are
reproducible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:36:44 +02:00
Ludovic Marie 1515c5e46c Add vanilla's team rules and compare them with vanilla
Friendly fire (doTeamsAllowDamage), alliances, collision rules
(EntitySelector.pushableBy), seeing invisible team mates (isInvisibleTo),
name tag visibility (LivingEntityRenderer.shouldShowName) and who sees a
player's own death message. tools/test_team_rules_parity.py runs vanilla's
methods on stand-in entities and a stand-in client over 6000 cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:36:04 +02:00
Ludovic Marie eb9bee05bd Run the loom and the crafter menu on the verified menu engine
LoomMenu (selectable patterns, clickMenuButton, the six-layer limit,
quick moves, the result's onTake) and the server's CrafterMenu over the
block entity (the result following the grid, slot state packets, filled
disabled slots enabling) join the menu click harness, now 8,000 click
sequences over 19 menus with pattern button and slot state ops. Slot
clicks end with setChanged and container slots are limited to their
stack size as SimpleContainer does. The game's loom and crafter screens
now click through Game::menu_session on the same engine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:31:00 +02:00
Ludovic Marie b8711a7c64 Add a sculk vibration harness against a vanilla server level
VanillaSculkOracle runs sensor, calibrated sensor and shrieker scenarios
(scripted game events and block changes, the player's warning level) in
a real headless level ticked in ServerLevel.tick's order; the game runs
the same scenarios through its own sculk code (HORIZON_SCULK_FIXTURE).

Fixes found on the way: sculk block entities tick in the order they were
added, the entity phase of sculk runs before the block entities, client
side effects of level events draw from the client random, scheduled
ticks run one at a time so a shrieker summons inline, wardens are
summoned as SpawnUtil does (obstruction by entities, the yaw and
finalizeSpawn draws, agitated sounds of discarded attempts), and an
empty level no longer draws the level random every tick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:25:06 +02:00
Ludovic Marie 68520308d0 Keep the scoreboard in vanilla's hash orders and save it as its codec does
The objectives, holders and teams now iterate as vanilla's fastutil maps and
each team's members as its HashSet; criteria resolve to their canonical
names as ObjectiveCriteria.byName does; scoreboard.dat leaves out the
fields equal to the codec defaults and writes components as
ComponentSerialization does. tools/test_scoreboard_parity.py runs vanilla's
own Scoreboard against the model on 500 scripted cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:23:34 +02:00
Ludovic Marie 81783a5125 Port PatrolSpawner, Raid and Raids exactly, and run the game on them
The patrol spawner, the raid tick (countdown, spawn positions, wave
composition, bonus wave, leaders, riders, boss bar, horn seed, raiders
leaving, victory, loss, celebration) and the raids.dat codec with
DataFixerUpper's partial results and fastutil's map order now follow
vanilla line by line. tools/test_raid_parity.py runs vanilla's own
PatrolSpawner, Raids and Raids.CODEC on a stand-in level: 1,900 cases
match.

In game, raiders join, are loaded, hurt and killed through addWaveMob,
updateBossbar and removeFromRaid as vanilla calls them, the wave leader
map lives in the raid, recruits take the raid's current wave, raid and
patrol mobs keep their spawn rotation, and each dimension keeps its own
raids.dat. Bad Omen and Raid Omen act from inside the effect tick, with
the ConcurrentModificationException vanilla swallows when Raid Omen is
first added, and the omen position is saved with the player.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:22:29 +02:00
Ludovic Marie 16227901fc Check the crafter against vanilla with a crafting harness
CrafterBlock.dispenseFrom and CrafterBlockEntity.serverTick over 4,000
cases: recipes from the datapack with remainders and specials, disabled
slots, containers and other crafters in front. The crafter now reports
its level events (1049, 1050, white smoke 2010) through the client
random, hoppers merge stacks only with equal components, brewing stands
take items as a WorldlyContainer, and empty written book pages are not
written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:05:18 +02:00
Ludovic Marie 95015b7828 Compare sniffer animation states, happy ghast layers and the llama decor model
The entity model harness now drives the sniffer's five keyframe animation
states and its search walk, the happy ghast body item, riding and leash
holder on its body, harness and ropes layers, and LlamaDecorLayer's model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:51:58 +02:00
Ludovic Marie 8a32850f95 Lay out the player list exactly as vanilla PlayerTabOverlay does
tab_list ports PlayerTabOverlay: the comparator (list order, spectators,
team, name ignoring case), the 80-player limit and 20-row columns, heads
with the default skin by UUID and upside-down names, team and spectator
name styling, ping bars, the list objective as integer scores in their
number format or hearts with their change blink and the hp text fallback,
and the wrapped header and footer. Font::split_lines now follows
StringSplitter.splitLines and Text::resolve_legacy applies legacy codes
inside components. test_tab_list_parity runs vanilla's overlay against
examples/tab_list_fixture: 1,000 cases, 3,476 frames, 844,758 calls match.

The protocol gains the scoreboard, team and world border packets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:47:55 +02:00
Ludovic Marie 84afe5a020 Merge origin/parity/rendering-hud into parity/rendering-be
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:40:54 +02:00
Ludovic Marie 36b944ec3d Merge origin/parity/rendering-anim into parity/rendering-be
Client-ticked animation state now drives the renderer alongside the End
portal and gateway rendering; gateways, whose ages and cooldowns the client
does not track yet, keep rendering settled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:40:50 +02:00
Ludovic Marie a086bd83ba Merge parity/entity-ai, parity/rendering-anim and parity/rendering-hud into parity/hud
Keep the nbt contents hook and stack_display_name from parity/hud with
rendering-hud's object_style and first-component sibling style.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:40:44 +02:00
Ludovic Marie 94508b4528 Merge remote-tracking branch 'origin/parity/rendering-anim' into parity/hud 2026-10-12 15:39:07 +02:00