Commit Graph

4750 Commits

Author SHA1 Message Date
Ludovic Marie 64a82acdab Merge pull request #405 from ludovic111/feat/shaderpack-preprocess
Java shader packs (1): horizon-shaderpack crate, Iris's preprocessor and options
2026-10-16 05:31:14 +02:00
LookImEcho-Rick f2bbd6e3dc Keep arrow-key camera controls out of chat and menus 2026-10-15 22:23:25 -05:00
Ludovic Marie 63453086b6 Trial spawners: become ominous, Trial Omen and ominous item spawners
A player seen with Bad Omen or Trial Omen turns a trial spawner ominous
(tryDetectPlayers' ominous branch): Bad Omen becomes Trial Omen, level
events 3020, the spawner's mobs vanish (3012) and the ominous config
starts over. While active, an ominous spawner drops an ominous item
spawner over a player or one of its mobs every 160 ticks
(spawnOminousOminousItemSpawner, getDispensingItems seeded per 30x20x30
cell); it floats, grows and turns for 60 to 120 ticks, then the item
falls or is fired down (OminousItemSpawner).

Zombies, piglins and zoglins read IsBaby from their tag, so the baby
zombie trial spawners spawn babies, and zombies save it.

The trial spawner harness covers the ominous branch, Trial Omen, the
discarded mobs and the item spawners' items, positions and delays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 05:04:30 +02:00
Ludovic Marie c4f915c9d1 Give trial chamber pots their loot, sherds and insertion
Generated chunks now keep the block entities Horizon does not model
(decorated pots, brushable blocks) as placed, like a loaded chunk's, so a
trial chamber pot keeps its loot table and sherds. The loot table is
rolled into the pot's item the first time it is read
(RandomizableContainer.unpackLootTable: the seed, else the table's random
sequence, else the level random), so breaking the pot drops it. Pots
render their sherds from the saved block entity, and DecoratedPotBlock's
useItemOn / useWithoutItem insert items (wobble, sounds, dust plume,
game event) or wobble and refuse.

Part of #223.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 05:04:06 +02:00
Ludovic Marie ed5427197f Show trial spawner and vault visuals
LevelEventHandler 3011-3021 (spawn, detect, eject, ominous and item spawner
particles and sounds, vault activation and deactivation), the trial
spawner's client tick (state particles, the spinning display mob, the
ambient sound) and the vault's client tick (idle smoke and flames, the
connection particles towards the player, the ambient sound).

Part of #223.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 05:03:47 +02:00
Ludovic Marie 3ac3efe749 Save round-trip: a vault's next state update moves with the clock
Vaults tick in the game now, and an idle one pushes
state_updating_resumes_at to gameTime + 20 on every update, so Horizon,
which saves later than vanilla, stores a later value. Stage 3 already
treats it as volatile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 05:03:38 +02:00
Ludovic Marie 2c07b5e621 Wire vaults into the game
Vaults are block entities now (loaded from saves and structure templates,
so trial chambers keep their ominous configs) and tick every game tick:
their state changes, sounds, level events and ejected rewards reach the
world, keys go in through VaultBlock.useItemOn before the item's own use,
and VaultRenderer draws the display item spinning inside the cage.

Part of #223.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 05:03:38 +02:00
Ludovic Marie 2567a4a41a Add the vault's server logic with a parity harness
vault::Vault is VaultBlockEntity with its config, server and shared data:
load and save, Server.tick (display item cycling, VaultState.tickAndGetNext,
ejection, transitions with their sounds and level events) and
VaultBlock.useItemOn / tryInsertKey (keys, rewarded players, fail sounds,
the reward roll with its random sequence).

tools/test_vault_parity.py runs 3,000 cases against vanilla through a new
mode=vault of the natural spawn oracle and fixture.

Part of #223.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 05:03:28 +02:00
LookImEcho-Rick d5fbe2b7d6 Fix launcher data preview scroll isolation 2026-10-15 22:02:18 -05:00
Cosmic 92236010fd Document the sulfur body component limitation 2026-10-15 22:22:07 -04:00
Cosmic 938f2ec884 Merge remote-tracking branch 'origin/main' into fix/sulfur-cube-inner-layer
# Conflicts:
#	crates/horizon-client/src/game/creatures.rs
2026-10-15 22:19:52 -04:00
Cosmic e43e8ae82b Match sulfur cube block placement, lighting and fuse flashes 2026-10-15 22:19:39 -04:00
Cosmic 18e9c14642 Render swallowed sulfur cube blocks and award Uh Oh 2026-10-15 22:12:08 -04:00
Ludovic Marie 9044ae30c9 Merge pull request #423 from ludovic111/fix/server-list-dialogs
Server list: confirm before deleting, vanilla Direct Connection layout
2026-10-16 03:51:54 +02:00
Ludovic Marie c72a5643a4 Merge remote-tracking branch 'origin/main' into fix/server-list-dialogs
# Conflicts:
#	crates/horizon-client/src/multiplayer.rs
2026-10-16 03:46:14 +02:00
Ludovic Marie 3315138536 Merge pull request #421 from ludovic111/fix/server-list-entries
Server list rows: favicons, styled MOTDs, player count colours, icon arrows
2026-10-16 03:46:02 +02:00
Ludovic Marie f8c22f4e72 Merge pull request #416 from ludovic111/fix/f3-crosshair
F3 shows vanilla's debug crosshair (world axes)
2026-10-16 03:45:58 +02:00
Ludovic Marie 128111ff27 Merge pull request #414 from ludovic111/fix/f3-on-top
F3 overlay like vanilla: on top of menus, debug GUI scale, default entries
2026-10-16 03:45:54 +02:00
Ludovic Marie 09e01f066f Merge pull request #409 from ludovic111/fix/graphics-preset-distances
Graphics presets set render and simulation distance like vanilla
2026-10-16 03:45:51 +02:00
Ludovic Marie fb5a307903 Merge pull request #407 from ludovic111/fix/allow-commands
Commands follow the world's Allow Commands
2026-10-16 03:45:47 +02:00
Ludovic Marie 7cad2d7284 Merge pull request #406 from ludovic111/fix/world-reopen-entities
Reopening a world no longer duplicates its entities
2026-10-16 03:45:43 +02:00
Ludovic Marie c163fbff83 The world backup toast slides in and out with its sounds
EditWorldScreen's SystemToast goes through vanilla's ToastManager: it
slides in from the right over 600 ms (squared), shows for 5 s times the
notification display time, slides out, and plays ui.toast.in / out. The
in-game toasts' slide moves to a shared toasts module for it.

Fixes #384

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 03:32:21 +02:00
Ludovic Marie 608507699c Classic world fields edit at a cursor: arrows, Home/End, Delete, clicks and drags
The world list's search, Edit World's name and Create New World's name and
seed kept only their String and appended to it. They now edit through an
EditBox (ui::Caret keeps the focused field's cursor, selection and scroll
between frames): EditBox.keyPressed's moves and deletions (Ctrl by word,
Shift to select), Ctrl+A/C/V/X on the selection, onClick placing the
cursor under the pointer (Shift extends, a double click within 250 ms
selects the word) and onDrag selecting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 03:05:46 +02:00
Ludovic Marie 03fe857ec2 Dropping from a menu swings the hand
LivingEntity.drop swings the main hand for every drop, so throwing a
slot's item with Q over the inventory, a container or a creative tab
plays the swing (the inventory's player model shows it). Horizon only
swung for the drop key in game; Player.drop's port now swings itself.

Fixes #442

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 03:05:26 +02:00
Ludovic Marie 5373998ee0 Level loading screen like vanilla: panorama, chunk map and progress bar
LevelLoadingScreen while the player waits for its chunks: the title's
panorama, blur and menu background when a world opens (Reason.OTHER),
the nether portal sprite after a nether portal, Loading terrain... above
the 17x17 chunk status map (ChunkLoadStatusView, radius 8, COLORS) and
the 200x2 progress bar easing towards LevelLoadProgressTracker's value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 03:05:21 +02:00
Ludovic Marie 93ea338bfd Holding the drop key keeps dropping, in game and in menus
KeyboardHandler.keyPress sends a key repeat (InputConstants.REPEAT) to
Screen.keyPressed and KeyMapping.click like a press, so holding key.drop
keeps throwing the held item, the hovered slot's item in a menu, and
the hovered item of a creative tab. Horizon dropped every repeat; the
drop key's now reach key_pressed. horizon-ctl `key KEY repeat` sends
one auto-repeat, for scripted checks.

Fixes #443

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 02:57:59 +02:00
Ludovic Marie 98321f5d8d World Options: tests of the layout and active states
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 02:52:47 +02:00
Ludovic Marie 9f7c1c3ce5 World Options: vanilla layout, headings, port box, lock, game rules and restrictions
WorldOptionsScreen in a HeaderAndFooterLayout: the title in the 33 pixel
header, the content in a ScrollableLayout over the in-world list
background between the separators, the footer buttons at h - 27.
Bold underlined category headings (FocusableTextWidget), the difficulty
button 130 wide beside its lock, Edit Game Rules... and Restrictions...,
the port EditBox always shown with its hint and error colour, and the
buttons' active states from updateButton and the update*Button methods.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 02:46:19 +02:00
Ludovic Marie a8e0dead35 Wayland: VSync off draws uncapped in a window
pre_present_notify ties winit's RedrawRequested to the compositor's
frame callbacks on Wayland, one per refresh, so a window drew at the
monitor's rate whatever the present mode. Only Fifo (VSync) asks for
that pacing now; Mailbox and Immediate draw as fast as the frame limit
allows, like vanilla's GLFW window.

Fixes #441

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 02:42:22 +02:00
Ludovic Marie 8ca9cda5f6 Pause menu: icon sprites centred and untinted like SpriteIconButton
CenteredIcon draws its 15x15 sprite at x + 20/2 - 15/2 = x + 3 (integer
division), y + 3, with the widget's alpha only: Horizon drew it at +2
and tinted it grey.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 02:26:36 +02:00
Ludovic Marie 9cec0dfb45 World list: hovered rows show vanilla's join arrow, a click on the icon joins
WorldListEntry.extractContent dims a hovered row's icon (0xA0909090) and
draws world_list/join over it, join_highlighted under the pointer;
mouseClicked joins the world when the click lands on the icon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 02:25:54 +02:00
Ludovic Marie d333780478 Merge pull request #420 from ludovic111/contrib/cull-leaves-387
Optional leaf and entity culling (Online5277's #387, rebased)
2026-10-16 02:13:02 +02:00
Ludovic Marie 964280aa00 Guests on a dedicated server keep their ops-based commands
Allow Commands is the integrated server's setting; a dedicated server's
guests run what their permission level allows (dedicated_server parity).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 01:18:08 +02:00
Ludovic Marie 457a5d7ce2 Merge pull request #440 from ludovic111/feat/launcher-owner-download
Launcher: download Minecraft from Mojang for a signed-in owner
2026-10-16 00:53:49 +02:00
Ludovic Marie 310a3fb73b Merge pull request #438 from ludovic111/feat/launcher-other-launchers
Launcher: prepare from Prism, MultiMC, Modrinth App, ATLauncher or GDLauncher
2026-10-16 00:53:37 +02:00
Ludovic Marie d56c6dfd23 Merge pull request #437 from ludovic111/fix/launcher-missing-files-error
Launcher: when Minecraft isn't found, say where it looked and what to do
2026-10-16 00:53:23 +02:00
Ludovic Marie d30df8ce33 launcher: download Minecraft from Mojang for a signed-in owner
When no folder has the pinned version and the selected Microsoft account
owns Minecraft: Java Edition (the mcstore entitlement, asked again with the
saved token), Prepare downloads it the way other launchers do: the version
JSON from piston-meta by its pinned sha1, the client jar, this system's
libraries (the JSON's os.name rules) and the asset index with its objects
(the sounds), each checked against its sha1, written whole, 8 at a time,
into the data folder's minecraft/ in the official layout. The next
preparations find it there first. An asset that fails is a line in the log;
anything else is an error.

Not signed in, or signed in without the game, the not-found error says so as
its last line. Ownership stays required: there is no other path to the
download, and nothing of Mojang's is part of Horizon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 00:46:57 +02:00
Ludovic Marie e0b5e25c1a Commands: prune suggestions in the chat only, like the client's tree
Brigadier's getCompletionSuggestions lists every child whatever its
requirement (command_parse compares it at permission 4, 2 and 0); only the
tree the server sends the client is pruned (Commands.sendCommands). The
player's chat now asks client_suggestions, which skips what the player
may not use; guests' ask_server requests keep brigadier's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 00:42:38 +02:00
Ludovic Marie b2e9fafbe0 launcher: prepare from Prism, MultiMC, Modrinth App, ATLauncher or GDLauncher
The official launcher crashes on some Linux systems (rdbt's Arch), and
Horizon only read its layout. Preparing now finds the pinned version in the
chosen folder (or a folder above it, so an instance folder works), then in
every launcher's default folder on Linux (Flatpak included), macOS and
Windows:

- the official launcher: versions/<v>/<v>.jar
- Prism Launcher, MultiMC: the jar their meta/net.minecraft/<v>.json names
  (a Maven name in libraries/), libraries/com/mojang/minecraft/<v>/...
- the Modrinth App: meta/versions/<v>/<v>.jar, meta/libraries
- ATLauncher, GDLauncher (data/, Next's datastore/):
  libraries/net/minecraft/client/<v>/client-<v>.jar

The client jar is checked against the lock's sha1. horizon-prepare reads the
official layout and pins the version JSON's own sha1, so files found
elsewhere are linked into that layout in the data folder
(linked-minecraft/), with the pinned version JSON from piston-meta (by its
sha1, checked) when the launcher keeps only its own format or a rewrite.
Nothing else is copied or downloaded. Every preparer, old Python ones
included, reads the linked folder as an official one.

When nothing is found, the error lists the chosen folder and every installed
launcher's, with what each lacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 00:40:31 +02:00
Ludovic Marie 71fc3482ba Merge pull request #404 from Online5277/fix/rail-mipmap-cutout
Preserve native sprite mipmaps in mixed-size texture arrays
2026-10-16 00:37:42 +02:00
Ludovic Marie 561efb340e launcher: say which folders were checked when Minecraft is not found
Prepare used to stop with "Minecraft 26.3 is not in <dir>. Play 26.3 once from
the official launcher, or choose another folder." followed by an unrelated log
line ("Checking Java and your Minecraft install"). It now lists every folder it
looked in with what each one lacks (no such folder, no versions/26.3/26.3.json,
no 26.3.jar) and the two ways out, one per line. A missing client jar is caught
here too, instead of later inside horizon-prepare.

Only a preparer process's "Exited with ..." gets the last log line appended;
the launcher's own errors are full sentences.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 00:24:43 +02:00
Ludovic Marie 2862f17e86 horizon-client: run a Java pack's full-screen passes over the world
A folder holding shaders/, or a .zip, in shaderpacks/ now loads from the
Shader Packs screen: every planned begin, prepare, deferred, composite
and final pass is translated and drawn each frame over Horizon's world,
with Iris's formats, clears and buffer flips.

The targets keep OpenGL's layout (the translator flips gl_Position and
remaps its depth), the world enters as OpenGL depth, and the pack gets
OpenGL matrices. Textures share four samplers by kind (Metal allows 16
per stage), and isnan/isinf test bits (Metal's fast math folds x != x).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 00:22:39 +02:00
Cosmic 23cadd8b65 Keep entity culling description within the UI line limit 2026-10-16 00:12:58 +02:00
Cosmic 6aea14c8a0 Add conservative opt-in entity culling 2026-10-16 00:12:58 +02:00
Cosmic 504a70c062 Add an opt-in Cull Leaves graphics setting 2026-10-16 00:12:45 +02:00
Ludovic Marie 5350f3465b Merge pull request #424 from ludovic111/test/lan-e2e
tools/lan_e2e.py: a LAN host and guest, checked from both sides
2026-10-16 00:10:22 +02:00
Ludovic Marie 99cd0ec0ad Merge pull request #430 from ludovic111/fix/lan-guest-damage
LAN guest: fall damage, regeneration and hunger on the host
2026-10-16 00:10:16 +02:00
Ludovic Marie a42db752d7 Merge pull request #429 from ludovic111/fix/lan-guest-crafting
LAN guest: crafting in the 2x2 grid and at a crafting table
2026-10-16 00:10:10 +02:00
Ludovic Marie de53b7c14e Merge pull request #428 from ludovic111/fix/lan-player-nametags
LAN: name tags over other players, and the host under its own name
2026-10-16 00:09:58 +02:00
Ludovic Marie e2fa721c7a Merge pull request #427 from ludovic111/fix/lan-chest-lids
LAN: chest and shulker box lids open and close for every player
2026-10-16 00:09:53 +02:00