Commit Graph

4750 Commits

Author SHA1 Message Date
Ludovic Marie 4f2674275d horizon-prepare: keep the registry and command reports with the prepared files
A dedicated server reads registries.json and commands.json (the data
generator's reports) next to the prepared resources, and otherwise only
finds them in the .local/datagen folder of a development checkout. A
prepared folder copied or mounted on its own, as the Docker image
expects, stopped the server at start with "registries.json not found
next to the resources". The prepare step now copies both reports into
the folder (again whenever the server jar changes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 01:31:19 +02:00
Ludovic Marie e7003e7d49 Dedicated server: online mode, and refused logins in the log
online-mode=true now authenticates players as vanilla's
ServerLoginPacketListenerImpl does. The server makes a 1024-bit RSA key
pair at startup ("Generating keypair"), sends it with a random challenge,
checks the challenge and decrypts the shared secret from the client's key
packet, encrypts the connection with AES/CFB8, and asks the session
service's verify endpoint (hasJoined, through the services discovery
document) whether the player joined with the server's hash, from the
"User Authenticator #N" thread. A verified profile keeps its UUID and
properties, so skins show in the player list; an unverified one is
refused with "Failed to verify username!", and an unreachable service
with authservers_down. The offline-mode warnings are only printed in
offline mode.

Refused logins are logged as vanilla logs them: "Disconnecting
<name> (/<address>): <reason>" and "<name> (/<address>) lost
connection: <reason>", with log-ips respected.

horizon-protocol gains RSA key generation (Miller-Rabin primes,
e = 65537), the X.509 encoding of the public key and PKCS#1 v1.5
decryption. test_online_mode_parity.py runs its logins against Horizon's
server too, plus a verified player the whitelist refuses, and compares
the two servers' log lines about the player.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 01:31:18 +02:00
Cosmic 6285a15cf3 Default to Classic menus while preserving explicit preferences 2026-10-16 19:15:02 -04:00
Cosmic d652b25ead Package registry reports and recover from incomplete server resources 2026-10-16 19:12:40 -04:00
Ludovic Marie 7384db307d Block textures: share identical sprites, and draw past 2048 layers
Every block sprite is a layer of one texture array, and GPUs give an array
at most 2048 layers (Metal, most Vulkan drivers). Vanilla takes 1250; eight
real NeoForge mods carried over (docs/modpacks.md) take 2183, and the game
stopped at start with "GPU supports 2048 texture layers; 2200 required".

- Sprites: a still texture with the same pixels and mip settings as one
  already loaded reuses its layer (mods copy vanilla's textures under their
  own names): 17 layers fewer for those mods, none for vanilla.
- The renderer splits the layers over up to four arrays of 2048 (8192
  sprites). terrain.wgsl picks the array per fragment with derivatives taken
  in uniform control flow; a pipeline constant keeps vanilla, which needs one
  array, on the same single textureSample as before.
- HORIZON_SPRITE_SPLIT (dev only) forces a smaller split: vanilla drawn from
  three arrays of 512 renders the same blocks as from one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 01:10:35 +02:00
Cosmic 7f4636fcb5 Merge origin/main into equipment attribute tooltips 2026-10-16 18:53:05 -04:00
Cosmic 43d5ed8246 Play menu button clicks after world teardown 2026-10-16 18:52:00 -04:00
Cosmic e6068b1246 Remember Direct Connection addresses in both menus 2026-10-16 18:51:25 -04:00
Ludovic Marie cf4f95f3d8 Merge remote-tracking branch 'origin/main' into HEAD 2026-10-17 00:48:02 +02:00
Ludovic Marie f535d1b48c Merge pull request #556 from ludovic111/feat/horizon-bots
horizon-bots and tools/server_bench.py: the first server benchmark against vanilla
2026-10-17 00:47:54 +02:00
Ludovic Marie ee3a160cbd Merge pull request #555 from ludovic111/feat/horizon-server-panel
horizon-server: the web panel
2026-10-17 00:47:51 +02:00
Ludovic Marie 652e547b53 Merge pull request #554 from ludovic111/feat/horizon-server-packaging
horizon-server: install scripts, a Docker image, and boot services
2026-10-17 00:47:47 +02:00
Ludovic Marie f3f2301dce Merge pull request #553 from ludovic111/feat/horizon-server-backups
horizon-server: backups, restore and automatic backups
2026-10-17 00:47:43 +02:00
Ludovic Marie f04562c640 Merge pull request #552 from ludovic111/feat/horizon-server-control
horizon-server: start, stop, status, cmd and logs through a local control API
2026-10-17 00:47:39 +02:00
Ludovic Marie 000fafa9bd Merge pull request #551 from ludovic111/feat/horizon-server
horizon-server: server.toml, init, and a supervisor that runs the game
2026-10-17 00:47:35 +02:00
Ludovic Marie 7d57523c63 Merge pull request #572 from ludovic111/fix/falling-damage-pack
Fix main build: falling anvil wear reads blocks from self.pack
2026-10-17 00:47:32 +02:00
Ludovic Marie 3c28f55ce3 Merge main into fix/banner-item-components
Resolve game.rs and titles.rs against the resources split (#537): layer
names and item names now come from self.pack, the atlas from self.atlas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:47:22 +02:00
Ludovic Marie 2e2645ba9d Fix main build: falling anvil wear reads blocks from self.pack
#528 was tested before #537 moved the asset registry from Resources to
the reloadable pack, so main stopped compiling after both merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:35:45 +02:00
Ludovic Marie b324ee7e3a Merge pull request #528 from Online5277/fix/falling-anvil-damage
Apply falling anvil impact damage and wear
2026-10-17 00:31:30 +02:00
Cosmic e5fcdaaec6 Show full equipment tooltips in Creative item tabs 2026-10-16 18:26:12 -04:00
Ludovic Marie 361c994d98 Draw the columns vanilla draws: ChunkTrackingView.isInViewDistance
Vanilla draws a section when its column is within the render distance of
the camera's column with a column of slack on each axis
(SectionOcclusionGraph.isInViewDistance → ChunkTrackingView): 533
columns at render distance 12. Horizon meshed a circle of radius 12 (441
columns) and drew sections whose centre lay within 16 x distance + 24
blocks, so the edge of the world, mostly in fog, missed columns vanilla
shows, and fell short of vanilla's corners.

`streaming::in_view_distance` is vanilla's test. Streaming meshes the
columns it accepts around the player (and forced ones), and the
renderer's column walk draws the ones it accepts around the camera.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:23:02 +02:00
Ludovic Marie a71d148ca5 Network players have status effects
A player who joins over the network, which is now single player's own
player on its server thread, had no status effects: what they drank, ate
or were given went to the host, and their client never heard of any.

- Each guest has their own effects. `as_guest` trades them, and what
  their body was given for them (attribute modifiers, armor protection,
  enchantment modifiers), with the host's while the guest acts.
- They tick on the server with the guest's body (LivingEntity.baseTick's
  tickEffects), spectators included.
- The client is told as vanilla's ServerPlayer does: every effect when
  placed (PlayerList.sendActivePlayerEffects), then added (blended),
  updated, refreshed every 600 ticks left, and removed. An effect that
  only counted down is not sent again.
- The client keeps its own effects from those packets
  (LivingEntity.forceAddEffect), counts them down (tickClient), and its
  predicted movement, HUD icons and night vision follow them. A respawn
  starts without effects on both sides.
- Guests save and load them in their player file.

Saving also stops writing effects that have run out: the loaded player
compound kept the old `active_effects`, and they came back on reopen.
Potions in flight now tick on a server without a local player too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:22:53 +02:00
Ludovic Marie 65a6ab7fa4 Merge main into fix/sulfur-cube-inner-layer
Resolve minecarts.rs against the resources split (#537): the block model
catalog now lives in self.pack. Fill MobData's new villager_hats and pois
fields in the sulfur cube render test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:21:04 +02:00
Ludovic Marie 30d11d6a2e Integrated server: single-player pause menu labels
On its server thread a single-player world is joined like a server, so
the Horizon pause menu named it "Multiplayer" with a "Disconnect" button,
and F3+Escape opened the full menu as on a server. The server thread now
hands the window the world's name with its connection, the pause menu
shows that name and "Save and quit", and `has_singleplayer_server`
(Minecraft.hasSingleplayerServer) covers both ways of running a world for
the pause checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:12:08 +02:00
Ludovic Marie bd0dd979a0 Integrated server: build only the font, not the whole HUD atlas
The integrated server draws nothing, but it built the window's full HUD
atlas (GUI, item, block, entity and particle textures plus the run-time
slots). It now builds an atlas of the font sheets only, reads the glyph
widths from it and drops the pixels: text still measures the same (books
split their pages with it), without holding the textures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:12:08 +02:00
Ludovic Marie 19aac92bb7 Merge pull request #545 from ludovic111/perf/integrated-memory-connection
Integrated server: join through memory instead of a socket
2026-10-17 00:11:50 +02:00
Ludovic Marie 44c3ebb0d8 Merge pull request #544 from ludovic111/perf/integrated-server-thread
Run single player on an integrated server thread (opt-in)
2026-10-17 00:11:47 +02:00
Ludovic Marie 4e9495175c Merge pull request #538 from ludovic111/perf/game-constructor
Build the game in Game::new instead of inside run()
2026-10-17 00:11:42 +02:00
Ludovic Marie 9726af184b Merge pull request #537 from ludovic111/perf/resources-shared-split
Split Resources into shared read-only data and per-game pack state
2026-10-17 00:11:38 +02:00
Ludovic Marie 0560bbf876 horizon-port-pack report: coverage per mod, and ATM10 measured
`report <work>` writes coverage.json and coverage.md: per mod ported,
partial, not yet or not needed with the reason, and the totals by class,
tier and licence family. It reads the inventory, each mod's carry report
and its harness result: ported is a green harness with nothing left out
(blocks with a class of their own are counted and named); partial lists
the failing checks, the blocks left out and what the templates miss; not
yet names the API tier or the dependency it waits for; not needed covers
libraries, performance mods and pack tooling. Unclassified mods are not
yet, never not needed.

`import` also reads Crash Assistant's modlist.json, the list ATM10
publishes in its repository (mod ids, names, versions, Modrinth hashes,
the loader entry), and the inventory uses its mod ids and names when
there is no jar.

ATM10 (496 files, the eight mods we downloaded carried and checked):
ported 1, partial 7, not yet 367, not needed 121.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 23:28:43 +02:00
Ludovic Marie 32f5f01e22 Per-mod parity harness against a dev-only NeoForge oracle
The harness the modpack design calls for, for data-tier mods:

- tools/neoforge_oracle.py installs a NeoForge 21.1.259 server (ATM10's)
  under .local/neoforge-oracle, builds the exporter in
  mods/horizon/src/neoforge-oracle (our code, never shipped), runs it
  headless with the user's jars and writes every block (class chain,
  states, per-state hardness, light, tool need, map colour, sounds,
  outline and collision; drops for hand, diamond tools, shears and silk
  touch; placement; BlockSetType and WoodType), item, recipe and tag of
  the mods' namespaces, plus the vanilla blocks for templates. About 30 s.
- examples/mod_port_probe.rs builds the content root from the carried
  mods and dumps what Horizon's loaders make of the same things.
- tools/mod_port_harness.py compares them per mod and writes
  <work>/mods/<id>/harness/result.json. 1.21.1 sound events map to 26.3's
  through vanilla blocks both have, and vanilla items newer than 1.21.1
  are not counted against a recipe.

On ATM10's own jars (MIT): Macaw's Trapdoors passes everything; Doors,
Fences, Paths, Glassential, Factory Blocks and Cloud Glass pass every
drop, recipe, tag and placement and fail only on what API 0.2 cannot say
(shapes and sound events of their own, blocks of classes no vanilla block
shares). Jars, facts and results stay in the work folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 23:27:20 +02:00
Ludovic Marie 886def4360 horizon-port-pack carry: templates and numbers from the NeoForge oracle, 1.21.1 loot upgraded
Carrying over seven real ATM10 mods (Cloud Glass, Factory Blocks,
Glassential, Macaw's Doors, Fences, Paths and Trapdoors) showed what the
guesses missed:

- Loot tables: 1.21.1's `conditions` lists, `functions` and
  `condition`/`function` kinds are now 26.3's single `condition`,
  `modifier` and `type`; silk-touch and shears tool matches become
  `minecraft:tool/can_silk_touch` and `can_shear`. Before, every drop
  condition was ignored (glass dropped itself by hand, upper door halves
  dropped doors, double slabs dropped one).
- With the oracle's facts (<work>/oracle/facts.json, from
  tools/neoforge_oracle.py in the next PR), every registered block gets
  the vanilla template of the same vanilla class and states that matches
  its shapes, sounds, BlockSetType and WoodType best, and the mod's own
  hardness, blast resistance, light, tool need, friction, map colour and
  sounds. Items get stack size and rarity. The carry report lists what a
  template does not reproduce and why a block was left out.
- Convention tags a recipe uses (c:dyes/red) are written from the
  oracle's tags, vanilla and own members only; the jar's own c tags stay
  inside the mod.
- Without the oracle, blockstates that omit properties their models
  ignore (powered, waterlogged) still find their template, and names pick
  between fences and panes, doors and trapdoors.
- `version = "${file.jarVersion}"` is read from MANIFEST.MF.
- `--resources <prepared>` limits templates to blocks Horizon has.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 23:25:54 +02:00
Ludovic Marie ddc115e969 Content mods: load real carried-over mods (large tables, convention tags, mod recipes)
Loading seven real NeoForge mods carried over by horizon-port-pack (about
1,000 blocks) broke the content root in four places:

- The per-state NBT tables (cached collision, occlusion, movement, worldgen
  block properties and support) passed the NBT reader's 1M-node cap once
  mod states were appended. They are trusted prepared tables with a row
  per state, so they now read and write with Limits::tables() (16M nodes,
  256 MiB) everywhere they are loaded.
- The overlay linked the base root by the path it was given, so a relative
  base gave dangling links. The base is made absolute first.
- Carried-over tags name blocks the port left out and other mods' items.
  Vanilla fails such a tag as a whole; entries naming ids nobody registers
  (or tags nobody defines) are now dropped, so the rest loads.
- Mods use the convention tags (c:dyes/red, c:glass_blocks/colorless).
  Content mods may add to data/c/tags/ as to vanilla's, and with content
  mods loaded the tag loaders read the c namespace and the mods' own.

Stonecutter and smithing recipes in mod namespaces load too (ids
<ns>:<name>), as crafting and cooking ones already did. With no content
mod nothing changes: the loaders read the minecraft namespace only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 23:24:34 +02:00
Ludovic Marie 5dac64f770 Merge pull request #561 from ludovic111/perf/section-culling-columns
Renderer: cull sections by chunk column from a dense list (section walk 5x faster, exact)
2026-10-16 23:04:53 +02:00
Ludovic Marie 89740d39e0 Merge pull request #560 from ludovic111/perf/skip-indirect-validation
Renderer: skip wgpu's indirect-draw validation in release builds (−0.05..0.11 ms/frame of render thread at RD 32)
2026-10-16 23:04:01 +02:00
Cosmic 53955abf99 Hide ominous banner pattern descriptions in tooltips 2026-10-16 16:56:14 -04:00
Ludovic Marie 167339c03c Renderer: cull sections by chunk column, from a dense list
The per-frame section walk iterated a SipHash map of every resident
section, then looked each visible one up twice more by key. Resident
sections now live in a dense list grouped by chunk column: one distance
and frustum test rejects a whole column (exact: a section's box lies in
its column's box and the plane test rounds monotonically), the rest are
reached by slot, and the visible list sorts on integer keys with ties
broken by section key, so the order no longer depends on hash order.
FaceGroups looks its axes up in a table instead of searching for them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 22:54:17 +02:00
Cosmic 86ccd5d299 Render banner breaking cracks and oak-plank particles 2026-10-16 16:40:29 -04:00
Ludovic Marie 9b2825df34 Merge pull request #517 from Online5277/fix/world-list-text-details
Correct Classic world-list search hints and text placement
2026-10-16 22:32:01 +02:00
Ludovic Marie 7a27781ab5 Merge pull request #512 from Online5277/fix/classic-graphics-duplicates
Remove duplicated settings from Classic graphics submenus
2026-10-16 22:31:55 +02:00
Ludovic Marie af15fb1a98 Merge pull request #511 from Online5277/fix/cloud-face-alpha
Preserve cloud opacity when shading faces
2026-10-16 22:31:49 +02:00
Ludovic Marie 4ff55f7a99 Merge pull request #510 from Online5277/fix/fullscreen-all-screens
Handle fullscreen shortcut across menus and text fields
2026-10-16 22:31:42 +02:00
Ludovic Marie 6b86fa9bef Merge feat/horizon-server-panel into feat/horizon-bots
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 22:30:45 +02:00
Ludovic Marie b9d4ef3194 Merge feat/horizon-server-packaging into feat/horizon-server-panel
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 22:28:38 +02:00
Ludovic Marie 949751656a Merge feat/horizon-server-backups into feat/horizon-server-packaging
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 22:28:35 +02:00
Ludovic Marie 500241cbc6 Merge feat/horizon-server-control into feat/horizon-server-backups
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 22:28:18 +02:00
Ludovic Marie 2483f90779 Merge feat/horizon-server into feat/horizon-server-control
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 22:28:06 +02:00
Ludovic Marie 07f7e3aeab Merge remote-tracking branch 'origin/main' into srv-fix
# Conflicts:
#	Cargo.toml
2026-10-16 22:27:25 +02:00
Ludovic Marie a1b0d95db1 Merge pull request #557 from ludovic111/docs/server-design
docs/server.md: hosting a Horizon server, the design
2026-10-16 22:25:05 +02:00
Ludovic Marie 9c03535011 docs/server.md: hosting a Horizon server, the design
What the dedicated server does today (measured against vanilla 26.3), the horizon-server supervisor and
its packaging, server.toml, the CLI and TUI, the web panel, backups and updates, the control API and MCP,
the bot benchmark plan against vanilla and Paper, the working version for 2026-10-23, and the PRs that
build it (#551 to #556).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 22:22:56 +02:00