Commit Graph

381 Commits

Author SHA1 Message Date
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 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
Ludovic Marie 333135f672 Render the first-person arm and held item
Port FirstPersonHandsAndItemsRenderer: the right arm (player model,
default skin) or the held item with its firstperson_righthand display
transform, the arm swing (6-tick swing on attack, mining and placing)
and the equip height animation, drawn after clearing depth so it never
clips into the world.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 02:41:28 +02:00
Ludovic Marie 6c2bf5c138 Port speleothem growth, dripstone fluid transfer and cauldron drips
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 02:41:08 +02:00
Ludovic Marie f3770ce7c8 Add experience orbs, levels and bows
Ores and player kills drop experience split into vanilla orb sizes;
orbs fall, home in on the player within 8 blocks and are collected one
every 2 ticks, filling the XP bar with vanilla's level curve and the
level-up sound every 5 levels (saved as XpLevel/XpP/XpTotal). Bows
charge while held (BowItem power curve), consume arrows outside
creative, and player arrows hit mobs for ceil(speed * 2) damage with
critical bonuses.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 02:28:29 +02:00
Ludovic Marie 9698642804 Port pistons: structure resolver, block events and moving-piston ticking
Also fix PushReaction to the 26.3 enum (PUSH_PULL, PUSH, POPPED,
IMMOVEABLE, IGNORE_ENTITY).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 02:26:12 +02:00
Ludovic Marie f9fc6c8ffa Add structure templates, processors and template/fossil features
Load gzip NBT structure templates lazily with vanilla palette ordering,
apply processors (rule, block_ignore, block_rot, gravity, protected_blocks,
capped, jigsaw_replacement, block_age, lava_submerged) and place them with
rotation/mirror, waterlogging and block-entity data (loot seeds). Per-state
rotate/mirror tables and template ordering flags come from a new vanilla
exporter. Template and fossil features now decode, so desert wells,
fossils and sulfur springs generate; their block entities are kept on the
ProtoChunk. The prepare script bundles templates, processor lists, pools,
structures and structure sets.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 02:17:49 +02:00
Ludovic Marie 619339dca2 Add armor, buckets and tool block actions
Equippable items swap into armor slots (inventory screen slots with the
empty-slot icons, saved as vanilla slots 100-103) and apply their
attribute modifiers, so the validated vanilla armor and toughness
damage reduction applies; armor loses max(1, damage/4) durability per
hit. Buckets pick up and place water and lava sources; hoes till,
shovels make paths, axes strip logs and wood, flint and steel and fire
charges light fire, with vanilla sounds and tool durability.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 02:15:26 +02:00
Ludovic Marie 6dca05a35f Cull sections hidden behind opaque blocks (vanilla occlusion graph)
Each meshed section records VisGraph face connectivity through
non-opaque blocks; the renderer walks sections breadth-first from the
camera through connected faces without stepping back towards it, as
SectionOcclusionGraph does, and only draws reachable sections. The walk
is recomputed when the camera changes section or visibility changes,
and disabled when the camera is inside an opaque block.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 02:07:57 +02:00
Ludovic Marie a25aec0756 Document level integration and avoid per-call class-chain clones
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 02:06:50 +02:00
Ludovic Marie 330eed2769 Add precipitation ticks, chorus flower growth and vanilla lava double random tick
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 01:59:21 +02:00
Ludovic Marie bde9c632bb Port getStateForPlacement, BlockItem.place and useWithoutItem
PlaceContext resolves the replaced position as BlockPlaceContext does
(canBeReplaced per class, nearest looking directions), place_block runs
BlockItem.place with standing/wall and double-high items and setPlacedBy,
and use_without_item covers doors, trapdoors, gates, buttons, levers,
diodes, note blocks, cakes, composters, berries, pots, beds and menus.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 01:47:01 +02:00
Ludovic Marie 6907d9cdf8 Merge vanilla feature algorithms into chunk decoration
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 01:45:06 +02:00
Ludovic Marie a13799e042 Add title screen with world selection and creation
The game opens on a vanilla-style title screen (logo, Singleplayer,
Quit) over the spinning title panorama. Select World lists saves by
last play with game mode; Create New World takes a name, a seed
(numbers or text hashed like vanilla) and the game mode, and finds a
free folder name. Save and Quit returns to the title. README and the
parity status now describe the playable Rust game.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 01:44:42 +02:00
Ludovic Marie 6b80229269 Decode clamped_normal integer providers
Mth.normal sampling with float clamping and a saturating int cast, as used
by the pointed dripstone and sulfur spike placement offsets.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 01:38:28 +02:00
Ludovic Marie f11931e1d3 Add level block-behaviour module: setBlock, neighbour/shape updates, fluids, redstone, ticks
Behaviours loads per-block class chains, instance configuration and per-state
support/signal/fluid facts exported by VanillaBlockBehaviourExporter, and ports
Level.setBlock with the CollectingNeighborUpdater, updateShape for every
overriding class, canSurvive, FlowingFluid spreading with lava/water
interactions, gravity blocks, rails, tripwires, redstone wire/torches/diodes,
scheduled ticks and random ticks.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 01:22:03 +02:00
Ludovic Marie 253533930c Timed eating, hunger exhaustion and death drops
Food is consumed by holding use for 32 ticks with vanilla's eating
sounds and item particles in the last 25 ticks and a burp on finish
(FoodData.eat). Breaking blocks and attacking add 0.005 and 0.1
exhaustion. Dying throws the inventory out like Inventory.dropAll.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 01:14:06 +02:00
Ludovic Marie 77ea858a4b Render vanilla sun, moon phases, stars and fancy clouds
Celestial bodies follow SkyRenderer: the sun (30) and moon (20) at height
100 on a frame rotated by the timeline angles, the 1500 seeded stars at
the timeline star brightness, drawn additively behind terrain. Clouds
follow CloudRenderer: 12x4x12 cells from clouds.png drifting 0.03 blocks
per tick at the cloud height with per-face shading and the timeline
cloud colour. Adds --time and --look options for visual checks.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 01:11:57 +02:00
Ludovic Marie 6294126f70 Add chests, barrels and furnaces with block entities
Chests, trapped chests and barrels hold 27 slots; furnaces, blast
furnaces and smokers tick like AbstractFurnaceBlockEntity.serverTick,
reading fuel burn times and speed multipliers from the data-driven
context providers and toggling the LIT state. Container screens use
the vanilla layouts and progress sprites. Contents drop when broken,
persist in Anvil block_entities, and chests render from the vanilla
chest model with the eased lid animation. Entity model export now
writes NaN UVs of degenerate faces as 0.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 00:57:56 +02:00
Ludovic Marie 68fc42013c Merge feature algorithms branch and wire generator decoration hooks
Merge worktree-agent-a8b4c3c64b61988c7 (trees, ores, vegetation, lakes,
geodes, dungeons, icebergs, dripstone, fungus, end spikes). The decoration
world now supplies the world seed, the write-zone check, raw section
writes for bulk ore placement and full-block collision tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 00:41:47 +02:00
Ludovic Marie feb53b02f0 Add mobs: spawning, AI, combat, drops, arrows and explosions
Mob types use vanilla's exported dimensions and default attributes and
its baked LayerDefinitions models with walk/arm/swell animations.
Creature packs spawn at chunk generation from biome spawn lists and
monsters spawn in the dark near the player with vanilla's light checks.
Passive mobs stroll, look and panic; zombies, spiders and creepers chase
(creepers swell and explode with the ray-based vanilla explosion);
skeletons shoot arrows. Player melee uses the attack-strength charge,
crits and knockback; deaths drop from entity loot tables.

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