[GH-ISSUE #1750] Preparing a version without Java on the player's machine: publish the computed tables, assemble locally #527

Open
opened 2026-11-02 15:39:46 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @feeldev12 on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1750

Hi! I'm porting Horizon to Android, and I hit the problem many players have on PCs too: horizon-prepare runs Mojang's code on a JVM to compute its tables. A phone has no JDK, and on a PC it means finding or downloading Java and running the game's code once. I solved it like this; if the idea is useful here, I'm happy to open a PR.

It would matter beyond phones too: an iOS port has no practical JVM either (no JIT outside the system's own), and on desktop it would spare players installing Java just to prepare a version.

The idea

The tables horizon-prepare computes are the same for every player of a given version. Only the client jar and the asset store differ, and those are each player's own files. So I split preparation in two:

  1. Once per version, on a machine with Java (CI): run the full horizon-prepare --prepare, then horizon-prepare pack-facts --resources DIR --out horizon-facts-<version>.zip to package only the computed tables. Publish that zip, for example as a release asset with its SHA-256.
  2. On each player's machine, no Java: download the zip, check the hash, and run horizon-prepare assemble (also callable as a library: horizon_prepare::assemble::assemble(&Sources { facts, client_jar, asset_index }, out, progress)). It combines the tables with the player's own client jar and asset store into the usual --resources folder.

No Mojang code or assets are redistributed, only data computed from them. You may still want to weigh that call yourselves.

How I use it

  • My launcher assembles into a staging folder and swaps it in, so a failure keeps the old resources. A marker holding the tables' SHA-256 skips assembling when nothing changed.
  • On Android, after assembling, the client jar can be deleted: Horizon never reads it.
  • PC and Android assemble from the same tables, so they get the same resources. Horizon 26.3 plays from an assembled folder on both.

Would you take a PR adding pack-facts / assemble to horizon-prepare, and maybe a CI job that publishes the tables per version?

Originally created by @feeldev12 on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1750 Hi! I'm porting Horizon to Android, and I hit the problem many players have on PCs too: `horizon-prepare` runs Mojang's code on a JVM to compute its tables. A phone has no JDK, and on a PC it means finding or downloading Java and running the game's code once. I solved it like this; if the idea is useful here, I'm happy to open a PR. It would matter beyond phones too: an iOS port has no practical JVM either (no JIT outside the system's own), and on desktop it would spare players installing Java just to prepare a version. **The idea** The tables `horizon-prepare` computes are the same for every player of a given version. Only the client jar and the asset store differ, and those are each player's own files. So I split preparation in two: 1. **Once per version, on a machine with Java** (CI): run the full `horizon-prepare --prepare`, then `horizon-prepare pack-facts --resources DIR --out horizon-facts-<version>.zip` to package only the computed tables. Publish that zip, for example as a release asset with its SHA-256. 2. **On each player's machine, no Java**: download the zip, check the hash, and run `horizon-prepare assemble` (also callable as a library: `horizon_prepare::assemble::assemble(&Sources { facts, client_jar, asset_index }, out, progress)`). It combines the tables with the player's **own** client jar and asset store into the usual `--resources` folder. No Mojang code or assets are redistributed, only data computed from them. You may still want to weigh that call yourselves. **How I use it** - My launcher assembles into a staging folder and swaps it in, so a failure keeps the old resources. A marker holding the tables' SHA-256 skips assembling when nothing changed. - On Android, after assembling, the client jar can be deleted: Horizon never reads it. - PC and Android assemble from the same tables, so they get the same resources. Horizon 26.3 plays from an assembled folder on both. Would you take a PR adding `pack-facts` / `assemble` to `horizon-prepare`, and maybe a CI job that publishes the tables per version?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#527
No description provided.