Commit Graph

3685 Commits

Author SHA1 Message Date
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 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
Ludovic Marie 1c91fad962 Merge pull request #426 from ludovic111/fix/lan-player-armour
LAN: every player wears their own armour
2026-10-16 00:09:45 +02:00
Ludovic Marie 824fad45cf Merge pull request #425 from ludovic111/fix/lan-guest-self-model
LAN guest: the guest sees himself (own player model on a server)
2026-10-16 00:09:40 +02:00
Ludovic Marie fc97b78931 Server list: confirm before deleting, vanilla Direct Connection layout
Delete opens JoinMultiplayerScreen's ConfirmScreen (title, wrapped
warning, Delete and Cancel; Escape answers no) and only removes the
server on yes. Direct Connection puts its label at y 100 and the box at
116 like DirectJoinServerScreen, and Add/Edit Server its boxes at 66 and
106 like ManageServerScreen, labels one pixel in.

Fixes #380, #381

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 23:05:32 +02:00
Ludovic Marie 37f6481e14 Server list rows: favicons, styled MOTDs, player count colours, icon arrows
OnlineServerEntry draws the server's 64x64 favicon (from servers.dat, then
from each ping, saved back like updateServerList), the description as a
styled component with legacy codes, formatPlayerCount's dark grey with
grey numbers, and on hover the join and move arrows over the icon. The
icon's right half joins, its left quarters move the server up or down.

Fixes #365, #378, #370

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 22:53:15 +02:00
Ludovic Marie e1d9ae1dd7 horizon-shaderpack: plan a Java pack's full-screen passes like Iris
The begin, prepare, deferred, composite and final passes of a program
folder: what each writes (the later of DRAWBUFFERS and RENDERTARGETS),
which side of every ping-ponged colour target it reads (Iris's
BufferFlipper, with flip.* overrides), mipmapped targets, scale.*, and
the targets' formats, clearing and sizes from the consts of every pass
in Iris's order. The preprocessor now keeps the directive comments of
active code, as Iris's does, so a DRAWBUFFERS in an #if'd out branch
doesn't count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 22:36:18 +02:00
Ludovic Marie 38a9f6543f horizon-shaderpack: read shaders.properties like Iris
Java .properties parsing, the two reads Iris makes (the raw file for
screens, sliders and profiles; the preprocessed one, with enabled options
and the environment's macros defined, for everything else), option
screens, profiles and the current one, program.*.enabled through a port
of Iris's BooleanParser, image formats for shadowcomp's writeonly
images, and blend overrides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 22:36:18 +02:00
Ludovic Marie 98ebdcad7b horizon-shaderpack: translate Java shader pack programs to WGSL
The legaliser of docs/shader-packs.md step 1, on a syntax tree (glsl-lang)
instead of the spike's tokens: attribute/varying to located in/out with
matrix and array varyings split, loose uniforms in one std140 block that
extends across a pass, combined samplers split into texture + sampler
bindings (through function parameters, respecting locals that hide them),
compatibility built-ins and Iris's core-profile names declared, legacy
texture and shadow calls, hoisted global initialisers, sized unsized
arrays, isnan/isinf/modf helpers, and dead code after a jump dropped (the
spike's 'naga constructor bug' in BSL was code after discard). naga then
parses, validates and writes WGSL. The programs of one pass share a Link
so locations, bindings and the uniform layout agree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 22:36:18 +02:00
Ludovic Marie b22583d057 horizon-shaderpack: open Java shader packs and preprocess them like Iris
A new crate for the OptiFine/Iris translation (docs/shader-packs.md, order
step 1, first half): open a pack folder or zip (shaders/ found as Iris finds
it), list its programs per dimension folder, build the #include graph,
discover options per include component (OptionAnnotatedSource rules: boolean
defines referenced by #ifdef, value defines and configurable consts with a
[...] list, conflicting defaults dropped), write the player's values into
the lines, and expand Iris's standard macros with pp-rs, keeping line
numbers so errors name file:line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 22:36:18 +02:00
Ludovic Marie d28521f765 Merge pull request #362 from ludovic111/feat/dualsense-lights
DualSense lightbar and player LEDs
2026-10-15 22:31:10 +02:00
Ludovic Marie 7d6936e000 Merge pull request #361 from ludovic111/feat/dualsense-vibration
DualSense vibration: shaped pulses, HD haptics on USB (opt-in)
2026-10-15 22:30:54 +02:00
Ludovic Marie 5419ef0ed4 Merge pull request #360 from ludovic111/feat/dualsense-triggers
DualSense adaptive triggers
2026-10-15 22:30:46 +02:00
Ludovic Marie 457fb77ab0 Merge pull request #403 from Online5277/fix/server-ping-tooltip
Show ping tooltips over multiplayer network bars
2026-10-15 22:29:59 +02:00
Ludovic Marie 850788d46c F3 shows the debug crosshair's world axes (#375)
The default debug profile enables 3d_crosshair while the overlay is open:
GameRenderer draws DebugCrosshairRenderer's axes one block ahead of the
camera (0.01 x GUI scale long; X red, Y green, Z light blue, 2 px over a
4 px black line) and Hud.extractCrosshair skips the 2D crosshair and its
attack indicator. Hidden with reduced debug info, in third person and
with F1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 22:24:03 +02:00
Ludovic Marie 77127ccfed F3 overlay like vanilla's DebugScreenOverlay (#363, #376, #377)
The overlay is drawn after screens and toasts, so it covers menus, and on
the title and options screens too (Gui.extractRenderState); F1 hides it
only in game. It lays out at the debug GUI scale (debugGuiScale, default
half the largest automatic scale) and shows the default profile's entries
sorted by id, split into vanilla's two columns: fps, version, position,
section position, performance impactors, system specs (CPU, display,
window, GPU, backend) and the integrated server's tick time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 22:12:56 +02:00
Ludovic Marie 13c4230431 Merge pull request #347 from ludovic111/feat/shader-pack-screen
Shader packs (3/3): pick a pack in Video Settings
2026-10-15 22:07:21 +02:00
Ludovic Marie 99dfeabfa5 Merge pull request #346 from ludovic111/feat/shader-pack-render
Shader packs (2/3): run a pack's composite stages over the world, with hot reload
2026-10-15 22:07:01 +02:00
Ludovic Marie 4a0c639f63 Merge pull request #345 from ludovic111/feat/game-mods
Mods in the game: Options > Mods, hooks and HUD panels, off by default
2026-10-15 22:06:46 +02:00
Ludovic Marie 18b5310b0f Merge pull request #343 from ludovic111/fix/sprite-interpolation
Interpolate animated textures like vanilla (prismarine, magma, stems, lit furnaces)
2026-10-15 22:06:39 +02:00
Ludovic Marie 5a0ad89207 Graphics presets set the distances like vanilla (#382)
GraphicsPreset.apply also sets render distance (8/16/32), simulation
distance (6/12/12), chunk update priority, smooth lighting and menu blur,
and its cloud range (32/64/128) and Fabulous entity distance (1.25)
differ from what Horizon set. Dragging the classic preset slider only
moved the label: the preset now applies whenever its value changes
(Options.applyGraphicsPreset), in both menu styles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 22:00:55 +02:00
Cosmic f5a795988b Draw sulfur cube cores before translucent shells 2026-10-15 15:56:59 -04:00
Ludovic Marie d1495076e6 Commands follow the world's Allow Commands (#372)
The single-player owner was always at permission level 4. Like
IntegratedServer.getProfilePermissions, the owner now gets OWNER (4)
only when the world allows commands, else ALL (0): /gamemode, /give and
friends answer "Unknown or incomplete command" and are not suggested
(the client's tree only holds usable nodes, Commands.sendCommands).
allowCommands is read from level.dat, set by World Options, and worlds
made without the Create New World screen take its default (Creative only).
The server console, the command harness and horizon-ctl `command` keep
the owner's level.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 21:53:24 +02:00
Ludovic Marie b66eea6506 Merge pull request #348 from ludovic111/feat/dualsense-hid
DualSense output over HID: the report, a writer thread, and rumble through it
2026-10-15 21:52:08 +02:00
Ludovic Marie b5a7138489 Reopening a world no longer duplicates its entities (#374)
Save and Quit to Title kept boats, minecarts, armor stands, item frames,
paintings and other non-mob entities in memory. Opening the world again
loaded them from disk a second time and the next save wrote both copies,
so each reopen doubled them until the game crawled. Closing and opening a
world now let go of every entity of the level (MinecraftServer.stopServer
unloads them with the level). tools/test_world_reopen_parity.py reopens a
world three times and checks its minecarts stay the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 21:43:25 +02:00
Cosmic 725146c0ca Generate sprite mips before array-only enlargement 2026-10-15 15:41:53 -04:00
Cosmic d675918db9 Show server latency when hovering network bars 2026-10-15 15:30:10 -04:00
Cosmic 9b4d5d5613 Keep gameplay hotbar selection out of open menus 2026-10-15 15:20:09 -04:00
Ludovic Marie 292873e11a Merge pull request #397 from ludovic111/feat/inventory-sort
Sort buttons for the inventory and chests (extra, off by default)
2026-10-15 21:08:49 +02:00
Ludovic Marie c6aefdb82b Merge pull request #396 from ludovic111/feat/mouse-tweaks
Mouse Tweaks-style inventory controls (extra, off by default)
2026-10-15 21:08:44 +02:00
Ludovic Marie 66dc8ce3a4 Merge pull request #395 from ludovic111/fix/creative-search-select
Clicking a creative search result selects the query
2026-10-15 21:08:36 +02:00
Ludovic Marie 6bf89f912c Merge pull request #393 from ludovic111/fix/quick-craft-highlight
Drag highlight and counts as AbstractContainerScreen draws them
2026-10-15 21:08:28 +02:00
Ludovic Marie 17feed1620 Merge pull request #392 from ludovic111/fix/shift-double-click
Shift + double-click moves every matching stack
2026-10-15 21:08:19 +02:00
Ludovic Marie 32f7356eda Merge pull request #391 from ludovic111/fix/creative-item-tab-clicks
Creative item tabs click as CreativeModeInventoryScreen does
2026-10-15 21:08:12 +02:00
Ludovic Marie 2f23a776f8 Merge pull request #398 from ludovic111/fix/pick-block
Pick Block picks from the inventory in survival
2026-10-15 21:08:03 +02:00
Ludovic Marie 8e6a129f6b LAN: every player model wears its own armour
The host drew each guest with the host's own armour (player_armor_layers),
and a guest ignored ClientboundSetEquipmentPacket, so it drew the host and
other guests bare-handed and without armour. Player models now carry what
they wear in extra.head..feet: the host fills it from the guest's armour,
the guest from SetEquipment (main and off hand too, for mobs as well), and
both draw HumanoidArmorLayer from it. The host also draws what a guest holds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 20:57:07 +02:00
Ludovic Marie dd856ec5f6 LAN guest: tick the player's own model on a server, so the guest sees himself
The player model (third person, the inventory's preview) was only ticked by
the single-player tick; on a server it was never created.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 20:57:07 +02:00
Ludovic Marie 227edf7517 LAN guest: crafting in the inventory grid and at a crafting table
A guest could not craft: the host's inventory menu for guests had no
crafting slots (0-4 were always empty), and a crafting table the guest
used switched the host's own grid to 3x3 and opened nothing for the guest.

The guest's inventory menu (window 0) and a crafting table window
(minecraft:crafting) now run the host's vanilla-checked menu engine
(horizon_client::menu, Kind::Inventory / Kind::Crafting) over the guest's
inventory, kept between clicks so drags work, with the usual click
corrections. The 2x2 grid and its result are real slots of the guest's
inventory menu, so the slot sync carries them. Closing a menu puts its grid
back into the inventory (dropped if full); a guest leaving keeps it too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 20:37:56 +02:00
Ludovic Marie 9948ff42aa LAN: other players' name tags, and the host under its own name
No player had a name tag: only mobs with a custom name drew one. The other
players now get theirs on both sides (the guests on the host, the players a
server sends on a client), shown as LivingEntityRenderer.shouldShowName
allows: no custom name or crosshair needed, a crouching player's only within
32 blocks, team visibility and colours by player name, the below-name score.

The host also joined its own LAN world as "Player": the guests' player
list, name tags and chat, the MOTD and the offline UUID now use the host's
profile name, as IntegratedServer does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 20:37:56 +02:00
Ludovic Marie 8d6b8b3f03 LAN: a trading screen a guest opens releases the chest it replaces
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 20:37:49 +02:00
Ludovic Marie f601630f05 LAN guest: fall damage, regeneration and hunger on the host
Nothing hurt a guest: the host only set a guest's position from its move
packets, so a fall did nothing, and their body never ticked on the server
(no damage clock, no regeneration, no food tick).

Each tick the host now runs a guest's server-side body like ServerPlayer:
the damage clock and Entity.baseTick's fluid phase, then
ServerPlayer.doCheckFallDamage for every move packet accepted that tick
(the supporting block, the fall distance and the landing, through the same
landing code as the host's own falls, so water resets a fall and lava
halves it), then peaceful regeneration and the food tick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 20:28:36 +02:00
Ludovic Marie 4718fef2ab LAN: chest lids open and close for every player
A chest a guest opened opened on the host only, and never closed: the
host ran the guest's open as its own player's (one opener, a local block
event), nothing was sent to the guests, and the guest's close was not
counted. Chests now count their openers like ContainerOpenersCounter (the
host and each guest; a guest's close, a menu it replaces and its leaving
take it off) and the block event goes to the guests too (shulker boxes as
well). A guest's client handles ClientboundBlockEventPacket and ticks its
block entities (ClientLevel.tickBlockEntities, without the server copy's
bell sound and gateway ticks), so lids move on its screen.

The control socket's block reply gives a chest's or shulker box's lid
openness (lid, 0..1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 19:53:23 +02:00
Ludovic Marie 9e2d46d54e Pick Block picks from the inventory in survival, as vanilla does
In singleplayer the middle button did nothing outside creative, and in
creative it overwrote the selected hotbar slot. It now runs the server's
handlePickItemFromBlock (tryPickItem): a stack of the block's item
already in the hotbar is selected; one in the main inventory is swapped
into getSuitableHotbarSlot (the first empty hotbar slot from the selected
one, else the first unenchanted); only creative adds the item when none
is there, moving what the slot held to a free slot. Servers already got
the packet and do this themselves.

Fixes #367.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 19:44:19 +02:00
Ludovic Marie adef2bdc24 Draw text selections with vanilla's colours and blink the field cursors
GuiGraphicsExtractor.textHighlight paints an inverting white fill, then
adds pure blue (GUI_TEXT_HIGHLIGHT, additive). Horizon only inverted, so
selections lacked the blue: black text on a light box, not blue text.
The anvil's name box skips the inversion (setInvertHighlightedTextColor
false), as in AnvilScreen.

The creative search and anvil name box now draw like EditBox: the cursor
blinks from when the field took the focus (300 ms on, 300 ms off), turns
into a bar once the field is full, and Select All highlights the value.
Sign lines draw their Select All highlight too.

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