Commit Graph

4750 Commits

Author SHA1 Message Date
Ludovic Marie 86dac330a5 Port vanilla block lighting and fluid rendering into the section mesher
Smooth lighting and ambient occlusion now follow BlockModelLighter
(cubic/partial faces, diagonal samples through light-permeable blocks,
light blending with the sky-borrow and zero rules, partial-face weights),
with vanilla's integer colour arithmetic, cardinal shading, quad light
emission, flat lighting for emitting or non-AO blocks, tint source counts
and random block offsets. Fluids follow FluidRenderer: occlusion against
neighbour face shapes, legacy-solid corner heights, flow-rotated UVs with
Mth.atan2 and the sine table, water overlay beside glass and leaves, back
faces and max(self, above) light. Flat model elements skip their
degenerate faces like UnbakedCuboidGeometry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:29:32 +02:00
Ludovic Marie b47260d560 Add a vanilla structure placement oracle
VanillaStructurePlacementOracle generates vanilla terrain with live
structure starts and references for the 3x3 chunks around a target, runs
the structure part of applyBiomeDecoration through a WorldGenRegion-like
level and dumps the target chunk's blocks and block entities. The
structure_blocks example does the same with Horizon's generator
(GeneratorWorker::set_structures_only skips placed features) and
tools/compare_structure_blocks.py reports the differences.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:28:58 +02:00
Ludovic Marie ae96d36d1b Explosion, crit and damage-indicator particles
ParticleEngine gains ClientExplosionTracker-style explosion bursts,
TrackingEmitter and ServerLevel.sendParticles spreads; explode() and
Player.attack spawn them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:26:51 +02:00
Ludovic Marie 94539db425 Light with vanilla shape occlusion and incremental relighting
Port LightEngine.shapeOccludes / getFaceOcclusionShape (occlusion.nbt) so
slabs, stairs, snow layers, paths etc. block light directionally, and use
ChunkSkyLightSources.isEdgeOccluded for sky sources. Block light now rises
into the section above the highest occupied one.

Block edits on lit chunks are relit in place with vanilla's decrease and
increase passes instead of recomputing the 3x3 chunks (and remeshing every
section of them); edits that race a chunk light job are replayed onto it.

examples/light_parity compares Horizon light with the SkyLight/BlockLight
arrays of worlds saved by the vanilla 26.3 server (0 differences on
villages, outposts and a slab/stair/snow scene; 181 of 113M sky values
differ where vanilla's worldgen light is stale) and checks incremental
relighting against full relights. tools/vanilla_world_check.py runs the
vanilla server headless; tools/anvil_dump.py prints NBT and region chunks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:25:41 +02:00
Ludovic Marie 26acaf8ebd Port the vanilla particle engine and client animateTick effects
particles.rs becomes a ParticleEngine with ~80 vanilla particle types
(constructors, ticks, size curves, light, sprite sets from
particles/*.json) and camera-rotation quads. animate_tick.rs ports
ClientLevel.animateTick: torches, furnaces, campfires (with block-entity
smoke), candles, leaves drips and falling leaves, lava/water, fluid
drips, portals, enchanting tables, end rods, spore blossoms, redstone,
bubble columns and biome ambient particles. Rain splashes follow
tickWeatherEffects. Adds a particle control command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:24:12 +02:00
Ludovic Marie 7d26eca09a Draw potion icons with their colour and a masked enchantment glint
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:22:01 +02:00
Ludovic Marie 829b29d60c Fill generated structure containers in the client
Chests, trapped chests and barrels written by world generation become
client containers; their loot tables are unpacked with the loot module
using the generated LootTableSeed and the container's biome. chunkgen_bench
can list generated block entities (HORIZON_BLOCK_ENTITIES).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:20:42 +02:00
Ludovic Marie cc32d9e8a0 Grow trees and apply bone meal in the client; add block control commands
Install the live feature registry (sharing the generator's worldgen bundle),
route bone meal through BoneMealItem.useOn, report biome names and the world
seed to block behaviour, play the bone meal sound and pop items from tall
flowers. GameLevel::max_y is now exclusive as LevelAccess documents. New
horizon-ctl commands: setblock, fill, getblock, container.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:20:22 +02:00
Ludovic Marie 231dd0c851 Fill container loot tables like vanilla LootTable.fill
New horizon_world::loot: pools, weighted and nested entries, the item
modifiers chest tables use (counts, damage, random and level-based
enchanting, potions, stew effects, instruments, filtered/discard),
conditions, the stack splitter and the slot shuffle, all with vanilla's
random draw order. tools/compare_loot_fill.py runs a new vanilla oracle
(VanillaLootFillOracle) against the loot_fill example: all 58 chest
tables match slot for slot over 42 seeds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:18:18 +02:00
Ludovic Marie 1c7a68da26 Add enchanting, anvil, grindstone, smithing, stonecutter and brewing stand menus
Workstation menus follow the vanilla screens: slot layouts, sprites, the
enchanting table's seeded offers with clues and galactic names, anvil
rename/repair/combine costs, grindstone disenchanting with experience,
smithing upgrades and trims, stonecutter recipe buttons, and the brewing
stand block entity with data-driven recipes. Item tooltips show rarity,
enchantments, potion effects and trims; enchanted items glint.
horizon-ctl gains menu commands (use, click-slot, click-gui, type, xp, ...).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:17:11 +02:00
Ludovic Marie 67f51123e8 Add vanilla font metrics with unifont fallback, languages, styled text and a Brigadier command core
Font: bitmap glyph ascent/oversampling, unihex glyphs rasterized on demand
into a reserved atlas region, bold/italic/underline/strikethrough and
StringSplitter wrapping. Languages layer lang/<code>.json over en_us.
The command module ports Brigadier parsing, suggestions and smart usage
with the vanilla argument types and the 26.3 command tree; game rules
use the 26.3 registry names and saved-data file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:16:22 +02:00
Ludovic Marie fa21ea7688 Add horizon-protocol: the 26.3 network protocol (version 777)
Primitive codecs (VarInt/VarLong, strings, positions, LpVec3, BitSets),
VarInt21 framing, zlib threshold compression, AES/CFB8 encryption, MD5
offline UUIDs, network NBT via horizon-world, item stacks with data
component patches, chunk and light payloads with paletted containers,
synched entity data, and typed packets for every connection state in both
directions with round-trip tests. Packet ids are generated from the data
generator's packets report. The probe example logs into a vanilla 26.3
server and decoded ~8000 packets (329 chunks) without errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:13:51 +02:00
Ludovic Marie 2940b5ac90 Add section mesh parity gate against the client's block and fluid renderers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:13:16 +02:00
Ludovic Marie 0a4a4ea643 Grow saplings, fungi and mushrooms and apply bone meal through live feature placement
Port TreeGrower (all growers incl. 2x2 dark oak, pale oak, mega spruce/jungle,
mangrove, azalea, poplar), BoneMealItem.useOn/growCrop/growWaterPlant and every
BonemealableBlock. Configured and placed features run on the live level via a
FeatureWorld/PlacementContext adapter with vanilla setBlock semantics. Also fix
torchflower crops never maturing and kelp growth into flowing water.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:09:34 +02:00
Ludovic Marie 133708b979 Generate end cities
Port EndCityPieces' section generators (house towers, towers, bridges,
fat towers and the single ship), the local collision rule of
recursiveChildren and the treasure chest data markers. Seeds 1 and 12345
match vanilla on all 158 End starts over 601x601 chunks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:08:38 +02:00
Ludovic Marie ddf81d3d04 Render block entities: chests, shulker boxes, banners, skulls, bells, pots, conduits, books, copper golem statues
Sections now report their block-entity blocks; a new block_entity_render
module draws them each frame with vanilla's baked layer models, renderer
transforms, animations (chest lids, banner wave, enchanting-table book)
and entity diffuse lighting. Adds setblock/fill control commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:08:35 +02:00
Ludovic Marie eb87b65888 Export feature block behavior when preparing the native client
The 127 skipped placed features were all skipped because the worldgen bundle
lacked worldgen/blocks/{block-properties,cached-collision,cached-support}.nbt
and the survival definitions, which prepare_native_client.py only copied from
a previous simple-block parity run. Run the vanilla exporter directly when
those files are missing, and say so in the client when they are absent.
With them, every placed feature of the three dimensions runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:06:35 +02:00
Ludovic Marie 3ab658161e Generate nether fortresses and nether fossils
Port NetherFortressPieces (bridge and castle piece weights, children,
moveInsideHeights, chests and the blaze spawner) and NetherFossilStructure
(noise-column floor search, template piece with the dried ghast). The
structure-start oracle and chunkgen_bench take a dimension; seeds 1 and
12345 match vanilla on 5024 of 5025 Nether starts over 301x301 chunks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:05:58 +02:00
Ludovic Marie b1e7217441 Add vanilla world diff tool and End gateway block entities in decoration
vanilla_diff compares Rust-decorated chunks with region files of a vanilla
world generated for the same seed; chunkgen_bench takes --dimension.
configure_end_gateway stores the exit of end_gateway_return gateways instead
of failing the feature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:03:50 +02:00
Ludovic Marie 9d624d0175 Add item components (enchantments, name, potion, trim) and the enchantment registry
Item stacks carry vanilla's extra components, saved in chunk and player NBT.
The enchantment registry loads from the data pack with ordered tags, the
EnchantmentHelper cost/selection rules, value effects and level-based values,
and the anvil, grindstone, smithing and stonecutter result rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:03:28 +02:00
Ludovic Marie 1b38d82aac Merge pull request #36 from ludovic111/ci/linux-only-by-default
Linux-only CI; other platforms only when started by hand
2026-10-08 12:29:00 +02:00
Ludovic Marie 8441c66bdb Run macOS only when started by hand
Everyday work is built and tested on Linux only. macOS and Windows jobs run only when started by hand (workflow_dispatch: gh workflow run <workflow> --ref <branch>), not on pull requests or pushes to main. Release workflows are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 12:24:41 +02:00
Ludovic Marie 3d070a6bf2 Point Java pack instructions at local builds after removing releases
GitHub releases were deleted; the Mac starter and packs are built with
tools/build_release.py instead of downloaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:56:41 +02:00
Ludovic Marie 7b0010a2f9 Make the Rust rewrite main (#34)
Make the Rust rewrite main
2026-10-08 11:51:29 +02:00
Ludovic Marie 072735b3ef Merge origin/wip/horizon-creative-tabs
Port the creative screen's Escape and E handling into key_pressed, which
the control socket shares with the window, and keep both exporter hashes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:51:15 +02:00
Ludovic Marie 6f718865c1 Merge origin/wip/horizon-structures-mansion-monument
Keep both branches' PieceWorld additions and one copy of the
StartContext::sea_level both added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:49:46 +02:00
Ludovic Marie 6ee06271c4 Merge remote-tracking branch 'origin/wip/horizon-structures-mineshaft-stronghold' into t3code/rewrite-minecraft-rust
# Conflicts:
#	crates/horizon-world/src/worldgen/structure/legacy.rs
2026-10-08 11:48:21 +02:00
Ludovic Marie a59462791a Merge remote-tracking branch 'origin/wip/horizon-structures-templates' into t3code/rewrite-minecraft-rust 2026-10-08 11:46:40 +02:00
Ludovic Marie 77f9c075ca Add a control socket and horizon-ctl to drive the client from scripts
`--control` opens a local Unix socket; horizon-ctl sends text commands and
prints JSON replies. Scripts can read status, press keys and mouse buttons,
look, teleport, give items, change render distance, take PNG screenshots
of the presented frame, and benchmark frame times without a person at the
keyboard. Under control, losing focus no longer pauses the game.

Key presses and play-screen mouse buttons move into shared methods so the
window and the socket take the same paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:42:52 +02:00
Ludovic Marie 34f4722e42 Show audited Java parity in the README and correct stale status
Score fourteen subsystems against the code (55% overall) and test that the
README percentage matches the table. Fluids, redstone, crop growth and the
Nether already run in the client; the native-client status still described
the old test-generator terrain without mobs or containers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:21:53 +02:00
Ludovic Marie f734f237cf WIP snapshot: creative inventory tabs and vanilla exporter
Uncommitted work from a finished agent worktree on ludothinkpad (/home/ludovic/.t3/worktrees/2026-10-03-i-want-you-to-retro-e5fa4461/t3code-ec3c613c), saved before the worktree was removed. Not built or verified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:20:17 +02:00
Ludovic Marie be05cae0da WIP snapshot: mansion, monument, ruined portal and temple structures
Uncommitted work from a finished agent worktree on ludothinkpad (/home/ludovic/.t3/scratch/2026-10-03-i-want-you-to-retro-e5fa4461/.claude/worktrees/agent-aecc9e1511b717b74), saved before the worktree was removed. Not built or verified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:20:09 +02:00
Ludovic Marie 5159883086 WIP snapshot: mineshaft and stronghold structures
Uncommitted work from a finished agent worktree on ludothinkpad (/home/ludovic/.t3/scratch/2026-10-03-i-want-you-to-retro-e5fa4461/.claude/worktrees/agent-ac2ea1edb29c4454e), saved before the worktree was removed. Not built or verified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:20:05 +02:00
Ludovic Marie 6a543b8887 WIP snapshot: structure templates and jigsaw follow-ups
Uncommitted work from a finished agent worktree on ludothinkpad (/home/ludovic/.t3/scratch/2026-10-03-i-want-you-to-retro-e5fa4461/.claude/worktrees/agent-a2bb16cfb9ff4be19), saved before the worktree was removed. Not built or verified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:20:01 +02:00
Ludovic Marie 6b6505c5db Merge remote-tracking branch 'origin/main' into t3code/rewrite-minecraft-rust
# Conflicts:
#	README.md
2026-10-08 11:18:46 +02:00
Ludovic Marie 3a7f2a2fbf Merge remote-tracking branch 'origin/worktree-agent-a2bb16cfb9ff4be19' into t3code/rewrite-minecraft-rust
# Conflicts:
#	tools/prepare_native_client.py
2026-10-08 11:18:39 +02:00
Ludovic Marie be1352b4dc Target ludodesktop only and drop the M2 Mac from scope
The Rust rewrite now targets one Linux machine (Ubuntu 26.04, i7-13700KF,
RTX 4080, GNOME on Wayland). macOS and Windows are out of scope; the Java
packs, including the Mac starter, remain available but are no longer developed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:18:30 +02:00
Ludovic Marie 0810ba02e6 Prepare native-client resources from a fresh checkout
Run the worldgen step after vanilla's data generator, which writes the
biome parameter tables it reads, and export entity-types.json with the
existing VanillaEntityTypesExporter. Without these, preparation failed and
the client exited with "No such file or directory" when loading mobs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:18:30 +02:00
Ludovic Marie 08b8e71838 Drop Windows from scope and add a native client packager
Horizon now targets Linux and macOS only: remove the Windows CI runners and
wgpu's DX12 backend, and update the scope docs. The Ubuntu RTX 4080 desktop
becomes the first physical Linux target. tools/package_native_client.py bundles
a release build with its prepared resources and a launcher for playing on
another machine of the same platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 10:48:58 +02:00
Ludovic Marie 5732ba362c Add piece-based structures: buried treasure, igloo, swamp hut, shipwreck, ocean ruin
Port StructurePiece's orientation frame and block helpers, template pieces
with data markers, chest/dispenser loot block entities and the five
smaller legacy structures. Structure stubs use the chunk middle (block 8).
For seed 0 over 97x97 chunks all 35 starts of implemented structure types
match the vanilla oracle (pieces, boxes, positions).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 03:39:16 +02:00
Ludovic Marie af747818f1 Drive the world with vanilla block behaviour
Breaking, placing and block interaction now go through horizon-world's
level module (Level.setBlock with neighbour and shape updates,
BlockItem.place/getStateForPlacement, useWithoutItem), replacing the
client's ad-hoc placement. Each tick runs scheduled block and fluid
ticks, random ticks within the simulation distance, block events and
moving pistons, so water and lava flow, crops and grass grow, leaves
decay, redstone and pistons work, and unsupported blocks pop off. Level
events become destroy particles and sounds, loot drops, falling-block
entities (landing through FallingBlockEntity rules), menus, sleeping,
cake and TNT.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 03:38:31 +02:00
Ludovic Marie f211ce9b12 Merge vanilla block behaviours (level module)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 03:30:01 +02:00
Ludovic Marie 146da2865a Add the Nether: portals, dimension travel and Nether rendering
Worlds now have dimensions with vanilla's per-dimension region folders
(DIM-1). The Nether generates with the vanilla generator, has no sky
light, Nether cardinal shading, its fixed ambient light, biome fog and
environmental fog (10..96), and no sky, sun or clouds. Lighting a fire
inside an obsidian frame creates a portal (PortalShape 2..21 x 3..21);
standing in it for 80 ticks (1 in creative) travels with 8:1 coordinate
scaling, reusing a nearby portal or building one (PortalForcer). The
player's dimension is saved in level.dat.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 03:29:47 +02:00
Ludovic Marie 653c717d52 Add native placement parity harness and game master item gating
Behaviours::placement_state exposes BlockItem placement-state selection
without writing to the level; tools/test_level_place_parity.py compares it
with vanilla (VanillaPlacementOracle) over random neighbourhoods: 20000/20000
cases match. PlaceContext gains can_use_game_master_blocks. Level module
formatted with rustfmt.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 03:22:22 +02:00
Ludovic Marie c5fc4d7eb5 Read 26.3 template block states and verify jigsaw starts against vanilla
Templates store palette states as id/properties; reading only Name made
every template block air. Add a vanilla oracle (structure placement, start
selection and Structure.generate over a chunk rectangle), a bench mode
dumping Rust starts in the same format, and a comparison script. For seed
0 over 97x97 chunks all 15 jigsaw starts (villages, trial chambers, trail
ruins, abandoned camps) match vanilla piece for piece.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 03:19:08 +02:00
Ludovic Marie 244d2e95cf Add native updateShape/canSurvive parity harness; port potent sulfur states
VanillaLevelShapeOracle evaluates BlockState.updateShape and canSurvive over
generated 5x5x5 neighbourhoods with a reflective LevelReader and records the
ticks requested through ScheduledTickAccess; level_shape_fixture does the same
through Behaviours. 40000/40000 random cases match. Walls, snow layers and sea
pickles now read position-dependent collision shapes (bamboo, speleothems,
shulker boxes) through DynamicSupport.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 03:04:21 +02:00
Ludovic Marie 29fee66f35 Beds: two-part placement, sleeping and respawn points
Beds place their head in the facing direction (undoing when blocked)
and break as a pair. Using a bed sets the respawn point and, at night
or in thunder with no monsters within 8 blocks, puts the player to
sleep; after 100 ticks the night is skipped and weather cleared, with
the vanilla sleep fade.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 03:01:18 +02:00
Ludovic Marie 2b72710268 Add weather: rain, snow and thunder
Port ServerLevel.advanceWeatherCycle (vanilla durations, smoothed rain
and thunder levels, saved in level.dat) and the WeatherAttributes rain
and thunder layers over the sky, fog, cloud, sky-light and star
attributes. Rain and snow columns render within 10 blocks down to the
first motion-blocking block, snowing where the biome is cold enough;
rain plays its ambient sounds, thunderstorms flash and thunder, and
undead no longer burn in the rain. Adds --weather for testing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 02:59:48 +02:00
Ludovic Marie 25dd5df9d5 Add options screen, options.txt and view bobbing
Options (FOV, render distance, sensitivity, master volume, GUI scale,
view bobbing) are reachable from the title and pause menus, use
vanilla's slider/button layout, apply immediately and persist in
options.txt with vanilla's keys and encodings. View bobbing ports
GameRenderer.bobView from the player's walk distance and bob.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 02:54:05 +02:00
Ludovic Marie f192d01eaa Generate jigsaw structure starts, references and terrain adaptation
Port structure sets (random spread with frequency reducers and exclusion
zones), vanilla start selection, JigsawPlacement (pool aliases, shuffled
jigsaws by selection priority, placement-priority queue, free-space
checks, expansion hack, rigid/terrain-matching junctions) and pool
element placement. Proto generation computes per-chunk references within
8 chunks and feeds the beardifier into the noise fill; FEATURES places
referenced starts per decoration step before that step's features.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 02:51:22 +02:00