Commit Graph

3685 Commits

Author SHA1 Message Date
Ludovic Marie ce6bc9c5c7 Merge pull request #320 from ludovic111/feat/trial-spawners-game
Trial spawners run in game
2026-10-15 12:32:58 +02:00
Ludovic Marie 96268647d3 Merge pull request #319 from ludovic111/feat/trial-spawners
Trial spawner state machine, checked against vanilla
2026-10-15 12:32:52 +02:00
Ludovic Marie d4c16084d7 Merge pull request #317 from ludovic111/fix/axe-copper-animation
Axes on copper: a shield in the off hand is raised first, and sculk sensors hear it
2026-10-15 12:32:40 +02:00
Ludovic Marie fd3d456de8 Merge pull request #315 from ludovic111/feat/minecart-sounds
Minecarts roll and rattle when ridden, and hits on vehicles sound
2026-10-15 12:32:32 +02:00
Ludovic Marie 23ac335b53 Merge pull request #314 from ludovic111/fix/offhand-render
Show the off-hand item in first person
2026-10-15 12:32:26 +02:00
Ludovic Marie 204e4fdccb Merge pull request #313 from ludovic111/fix/offhand-use
Use the off hand when the main hand passes: place blocks, eat, charge anchors
2026-10-15 12:32:20 +02:00
Ludovic Marie e00ce7c89e Merge pull request #312 from ludovic111/fix/offhand-crossbow-fireworks
Crossbows load firework rockets from either hand; bows and crossbows take held arrows first
2026-10-15 12:32:14 +02:00
Ludovic Marie 40d5b43e43 Merge pull request #311 from ludovic111/fix/shield-deflects-arrows
Shields turn arrows back, as vanilla does
2026-10-15 12:32:06 +02:00
rdbtCVS ed0febf163 Merge main and preserve tick chunk membership invalidation 2026-10-15 11:29:05 +01:00
Ludovic Marie ed3d1e1168 Trial spawners run in game
Trial spawner block entities are kept (generated chunks and saves), tick on
the server with the level random and random sequences, spawn persistent
mobs, eject their rewards as items and set their block state, with their
level events and shutter sounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 12:20:30 +02:00
Ludovic Marie ca76075cc9 Trial spawner state machine, checked against vanilla
mobs::trial_spawner: TrialSpawner and its state data, the registry
configs (data/*/trial_spawner), the six states, player detection with the
visual line of sight, mob spawns and reward ejection, read and saved as
vanilla does (a field that fails to decode takes its default alone).

tools/test_trial_spawner_parity.py ticks 2,500 random trial spawners in
VanillaNaturalSpawnOracle and natural_spawn_fixture and compares states,
spawns, events and ejected items line by line.

Also: copper grates have no visual shape; a slime's or magma cube's
obstruction box scales with the Size its spawn data sets; LootData::roll_split
for an empty-context getRandomItems.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 12:20:29 +02:00
rdbtCVS ef92004ede test(client): cache legacy shape identity keys 2026-10-15 10:57:28 +01:00
rdbtCVS bea9d4b765 perf(client): decode gameplay facts without a JSON document tree 2026-10-15 10:57:28 +01:00
Ludovic Marie ce4d520f55 Fishing line: the hand side is a float, as in vanilla
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:55:30 +02:00
Ludovic Marie e162f9cdb7 Axes on copper: a shield in the off hand comes first, and sculk hears it
Scraping and waxing off copper already swing the arm, show the scrape and
wax-off particles and play the axe sound on main (#59, #104). Two gaps were
left in BlockTransformer.transformBlock:

- playerHasBlockingItemUseIntent: with a shield in the off hand, right-clicking
  with an axe raises the shield instead of scraping, unless sneaking.
- The block_change game event, which sculk sensors pick up.

Fixes #222

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:47:02 +02:00
Ludovic Marie 64739d2b8b Show the off-hand item in first person
FirstPersonHandsAndItemsRenderer draws both hands: the off-hand item sits
on the other arm with its own equip height and swing, uses its own pose
when it is the hand in use (eating, blocking, drawing a bow), and
evaluateWhichHandsToRender hides a hand while a bow or crossbow is drawn
or a charged crossbow is held in the main hand. Only the main hand's empty
arm shows, as in vanilla.

Part of #276

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:41:06 +02:00
Ludovic Marie 5e2935747b Use the off hand when the main hand passes: place blocks, eat, charge anchors
Minecraft.startUseItem tries each InteractionHand in turn: useItemOn, then
useItem, stopping at the first that succeeds or fails. Item uses now act on
the hand that started them (Game::hand), so blocks, food, potions, buckets,
spawn eggs and the rest work from the off hand, the swing and the
re-equip animation follow that hand, and the empty-hand block use
(useWithoutItem) stays main-hand only. The respawn anchor passes on the
main hand when the off hand holds glowstone, as vanilla does, replacing the
special case for it.

The use_item_on harness now puts items in the off hand too.

Part of #276

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:41:06 +02:00
Ludovic Marie ffd0297dc4 Crossbows load firework rockets from either hand; bows and crossbows take held arrows first
Player.getProjectile: what the weapon supports in the off hand, then in
the main hand (getHeldProjectile; crossbows also take firework rockets
there), else the first arrows in the inventory. Crossbows only looked
for arrows in the inventory, so a rocket in the off hand was never
loaded. A charged rocket is shot at an angle from 0.15 under the eyes
(CrossbowItem.createProjectile), every shot of a load holding one at
power 1.6 (getShootingPower), for three durability (getDurabilityUse).

Part of #276

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:41:06 +02:00
Ludovic Marie e2473aafd8 Shields turn arrows back, as vanilla does
AbstractArrow.onHitEntity: an entity that takes no damage from the arrow
(a raised shield, invulnerability) turns it back with
ProjectileDeflection.REVERSE at power 0.2: a tenth of the speed, a half
turn give or take ten degrees from the arrow's own random; one left
almost still drops its pickup and is discarded. Arrows used to vanish.

The arrow tick now stops at the entity it hits: the game hurts the
entity, then arrows::finish_entity_hit spends the arrow (with its hit
sound, from the arrow's random) or turns it back, and ends the tick
(drag, gravity, fluids). The damage is taken from the speed at the hit,
the crit bonus from the arrow's random, the entity search follows
ProjectileUtil.getManyEntityHitResult (the box first, then
computeMargin's margin, which needs tickCount), Punch pushes only what
was hurt, and a refused burning arrow leaves the player's fire as it
was. Mobs' refusals keep the old ending until their hurt results follow
hurtServer.

The arrow harness gains an entity in the way that takes or refuses the
damage: squarely, grazing, slow enough to drop.

Part of #277

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:41:06 +02:00
Ludovic Marie 72ff742273 Shield blocks: the player hears the block sound, not the hurt sound
LivingEntity.hurtServer's playHurtSound goes through Player.playSound,
which leaves the player itself out; the player hears its hurt sound from
the client's handleDamageEvent, and a blocked hit sends BlocksAttacks'
block sound (onBlocked) instead of the damage event. Queue the local hurt
sound on the damage broadcast rather than on the server's hurt sound.

Part of #277

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:41:06 +02:00
Ludovic Marie 050b203846 Merge pull request #306 from ludovic111/feat/debug-lightmap
F3+4 shows the lightmap texture in the bottom right corner
2026-10-15 11:39:03 +02:00
Ludovic Marie b6ced87869 Merge pull request #305 from ludovic111/feat/debug-charts
Debug charts: F3+2 frame and tick times, F3+3 ping and bandwidth
2026-10-15 11:38:57 +02:00
Ludovic Marie 89465a8c6d Merge pull request #304 from ludovic111/feat/create-world-tabs
Create New World: vanilla's Game, World and More tabs
2026-10-15 11:37:55 +02:00
Ludovic Marie fd8223061c Merge pull request #303 from ludovic111/feat/list-scrollbars
World list and pack lists: vanilla scroller, dragged with the pointer
2026-10-15 11:37:49 +02:00
rdbtCVS 0c161a0336 Cache random-tick section eligibility for unchanged chunks 2026-10-15 10:37:46 +01:00
Ludovic Marie 889fff562d Merge pull request #301 from ludovic111/feat/multiplayer-lan-scanning
Multiplayer: vanilla's server list, with the LAN scanning text and its animated dots
2026-10-15 11:37:43 +02:00
Ludovic Marie fbb458252f Merge pull request #299 from ludovic111/feat/menu-blur
Blur the panorama behind world selection, multiplayer and world creation, as vanilla does
2026-10-15 11:37:36 +02:00
Ludovic Marie b92cc7c9e8 Merge pull request #295 from ludovic111/feat/recipe-toast-icons
Recipe toasts show the workstation icon and cycle through the unlocked recipes
2026-10-15 11:37:23 +02:00
Ludovic Marie 61a127a2a2 Fishing: the rod casts, bites splash and bubble, and the line is vanilla's
- The fishing rod switches to its cast model while its hook is out
  (FishingRodCast), in first person, third person and the hotbar.
- FishingHook.catchingFish's particles: splashes where fish tease the bait,
  the fishing-particle trail and bubbles of a fish swimming up, and the
  bubble and fishing burst when it bites.
- FishingHookRenderer: the line is 16 black `lines` segments of the window's
  line width (2.5 px at 1080p) from a quarter block above the hook to the
  rod hand (on the near plane in first person, beside the body in third),
  and the bobber is centred on the hook.

Fixes #265

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:35:31 +02:00
Ludovic Marie adb19abd4c Minecarts roll, rattle when ridden, and take hits with the attack sounds
MinecartSoundInstance follows every minecart in the level (entity.minecart.riding,
louder with speed, silent when the tick rate is frozen), and getting in one starts
RidingMinecartSoundInstance's two inside sounds (normal and underwater). Hitting a
minecart or a boat plays Player.attack's strong/weak (and knockback) sounds.

The sound_engine harness now replays both instances against the vanilla client.

Fixes #227

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:29:15 +02:00
Ludovic Marie 4abf648a85 Merge pull request #280 from ludovic111/fix/streaming-reload-loop
Stop reloading saved columns every frame after the player moves
2026-10-15 11:27:01 +02:00
Ludovic Marie 5d17c56d77 Merge pull request #269 from ludovic111/perf/worker-face-visibility
Load worlds ~4.7x faster: stop copying the face visibility table per mesh job
2026-10-15 11:26:54 +02:00
Ludovic Marie 9044c69429 Merge pull request #307 from ludovic111/feat/bee-hives
Bees live in hives and nests: they go home, come out in the morning and make honey (#208)
2026-10-15 11:18:21 +02:00
Ludovic Marie 5876014b57 Droppers and hoppers don't take a beehive for a container
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 10:36:37 +02:00
Ludovic Marie 1f4154c0df F3+4 shows the lightmap texture in the bottom right corner
DebugScreenOverlay.toggleLightmapTexture and showLightmapTexture: the 16x16
lightmap at 64x64 on a black border, 2 pixels from the corner, sky light up
and block light right, as vanilla's flipped blit. It shares the bottom of the
screen with the F3+2 and F3+3 charts, so each switch turns the others off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 10:31:14 +02:00
Ludovic Marie dc863a66a4 Create New World: vanilla's Game, World and More tabs
CreateWorldScreen as in 26.3: a MenuTabBar (tab sprites, header
separators, underline) over the transparent tab header, each tab's
GridLayout aligned at (0.5, 1/6) between it and a 33-pixel footer with
Create New World and Cancel.

Game: the world name box with its save-folder tooltip, Game Mode
(Survival, Hardcore, Creative), Difficulty and Allow Commands, locked
in Hardcore. World: World Type (Default, Superflat), Customize, the seed
box with its hint, and the Generate Structures / Bonus Chest switches.
More: Game Rules, Experiments and Data Packs. Tooltips follow vanilla's.

The choices reach the new world: hardcore, difficulty and allowCommands
in level.dat, and world_gen_settings with the flat preset, structures and
bonus chest written before streaming starts. Re-Create reads them back.

Fixes #281

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 10:24:52 +02:00
Ludovic Marie 6ae018055d Debug charts: F3+2 frame and tick times, F3+3 ping and bandwidth
DebugScreenOverlay's FpsDebugChart, TpsDebugChart, PingDebugChart and
BandwidthDebugChart with vanilla's scales, colours and places: 240 samples
(LocalSampleLogger), F3+2 and F3+3 toggles that show the overlay and exclude
each other, the overlay's "Debug charts" lines, and the play-state ping
request and pong response packets the ping chart uses on servers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 10:16:02 +02:00
Ludovic Marie a8bd497132 World list and pack lists: vanilla scroller, dragged with the pointer
SelectWorldScreen's list now sits at vanilla's 49..h-60 with the list
background, header and footer separators, white selection outline and
the widget/scroller sprites at the row's right + 8. The scroller follows
the pointer while held (AbstractScrollArea.mouseDragged), the wheel moves
half a row, and the pack screen's lists can be dragged the same way.

Part of #282

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 10:04:37 +02:00
Ludovic Marie 3ed8abd25e Merge pull request #300 from ludovic111/fix/autosave-spike
Autosave stops waiting for entity writes: no more 2 s freeze (#224)
2026-10-15 09:58:50 +02:00
Ludovic Marie c0e1095ea9 Merge pull request #294 from ludovic111/fix/arrow-interpolation
Arrows stop jumping along their path after they land (#278)
2026-10-15 09:58:46 +02:00
Ludovic Marie 9593d9e329 Merge pull request #292 from ludovic111/fix/golem-persistence
Copper golems keep the persistence vanilla saved (#289)
2026-10-15 09:58:42 +02:00
Ludovic Marie 587695e108 Multiplayer: vanilla's server list, with the LAN scanning header and its dots (#282)
JoinMultiplayerScreen's layout: the title centred in the 33-pixel header, the
ServerSelectionList between the separators (list background, 305-wide rows,
white selection outline, scissored rows, the scroller sprites), the footer
buttons centred in 60 pixels. The list always ends with the LAN header,
"Scanning for games on your local network" over LoadingDotsText's dots,
then the LAN games. Saved servers show two MOTD lines, the player count and
the ping, pinging or unreachable icon; Edit and Delete need a saved server.
The list scrolls with the wheel and a draggable scrollbar (ui::Scroll, after
AbstractScrollArea).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 09:48:14 +02:00
Ludovic Marie b18261cc79 Autosave doesn't wait for the entity writes
The autosave queued its chunks without waiting (#284), then saved the
entities with the waiting call. The region writer is one FIFO thread,
so the main thread still waited for every chunk queued before the
entities: a 1.9 s frame at the 5-minute autosave on a world with ~900
columns. Like PersistentEntitySectionManager.autoSave (saveAll's flush
only on save-all and quit), the autosave now queues the entities too.

Part of #224

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 09:39:04 +02:00
Ludovic Marie 6953710c74 Blur the panorama behind the title menus' screens, as vanilla does (#282)
Screen.extractBlurredBackground: every classic screen reached from the title
(world selection and creation, multiplayer, options) blurs the panorama with
vanilla's minecraft:blur post chain, three horizontal and vertical box blur
passes of menuBackgroundBlurriness pixels, then draws menu_background over it
instead of a flat dark fill. The title screen itself stays sharp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 09:32:16 +02:00
Ludovic Marie 02cfbf6f28 Merge pull request #298 from ludovic111/fix/firework-entity-light
Draw flying firework rockets as their lit item model like vanilla
2026-10-15 09:31:33 +02:00
Ludovic Marie eb1467f45f Merge pull request #297 from ludovic111/fix/leaves-option-remesh
Rebuild every section when See-Through Leaves, Smooth Lighting or Biome Blend changes
2026-10-15 09:30:39 +02:00
Ludovic Marie cf67db1873 Render firework rockets as their lit item model like vanilla
FireworkEntityRenderer submits the rocket's item in the GROUND context,
turned to the camera (and over on its side when shot at an angle), at the
packed light of its eye. Horizon drew a flat 0.5-block sprite at full
brightness, so rockets glowed at night and had no item shading.

Fixes #279

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 09:24:19 +02:00
Ludovic Marie 81b07d1dd9 Rebuild every section when a meshing option changes like vanilla
Options.cutoutLeaves, ambientOcclusion and biomeBlendRadius call
LevelExtractor.allChanged when they change. Horizon only handed the new
value to the mesher, so after turning See-Through Leaves off the loaded
sections kept their see-through leaves, pale against the sky, beside the
opaque ones of sections rebuilt later.

Fixes #273

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 09:24:19 +02:00
Ludovic Marie 1bfef88477 Render the world with reversed depth like vanilla
Vanilla 26.3's Projection passes its planes reversed and every pipeline
tests GREATER_THAN_OR_EQUAL. Horizon kept forward depth with a 0.05 near
plane, so far geometry lost precision and fire_side's quad, 0.01 pixel in
front of the block it burns on, z-fought with it.

Fixes #272

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 09:24:19 +02:00
Ludovic Marie 111b237b6d Bees live in hives and nests: they go home, come out in the morning and make honey (#208)
BeehiveBlockEntity (crate::beehive): up to three bees stored as entity
tags, out when their time is up (not at night, in the rain or through a
blocked front unless in an emergency), honey for nectar, the flower they
knew; vanilla's bees / flower_pos save format. Bees find a hive with room
(BeeLocateHiveGoal), fly home and go in (BeeEnterHiveGoal through
MobEvent::EnterHive). In the game hives tick, breaking one lets the bees
out angry unless smoked, fire empties it, dispensers release them.

mob_ai: bee_hive_night, _rain, _morning and _honey match vanilla.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 09:14:21 +02:00