[GH-ISSUE #5555] Content mods that fetch their assets by hash #1733

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

Originally created by @JuanLuci on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5555

Summary

An .hmod can name a remote file pinned by SHA-512 (the original mod's jar on Modrinth) and the paths to take from it. The game downloads it when the mod is first turned on, checks the hash, and reads those assets from its cache.

Why

Many mods license their code and their assets differently. Create's code is MIT, so it can be ported; its textures, models and sounds are All Rights Reserved, so a port cannot ship them. Fetching them from the mod's own official download on the player's machine keeps the port lawful and the .hmod small. On main the launcher's mod browser can download a Modrinth jar and port it (horizon-port-pack), but an .hmod cannot name remote assets, and nothing does it in game or for a server's players.

Proposal

  • In horizon-mod.toml: [[assets.fetch]] url = "https://cdn.modrinth.com/...", sha512 = "...", size = ..., take = ["assets/create/**"].
  • Downloaded once into a cache keyed by the hash, refused on a hash or size mismatch, with progress shown on the loading screen; a mod whose files are missing and cannot be fetched loads without them and says so.
  • Only hosts the player's own launcher or game already trusts (Modrinth's CDN, maybe CurseForge's), so a mod cannot point the game anywhere.

This is the form my fork uses (a manifest entry, not a hook); the exact implementation is open to change.

How I did it on my fork

My fork has this as [assets.fetch]: horizon-mods/src/fetch.rs and game/mod_assets.rs (bd887b2d4). My Create port fetches the 19 MB Create jar from Modrinth on first use and reads the assets from it.

Originally created by @JuanLuci on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5555 ## Summary An .hmod can name a remote file pinned by SHA-512 (the original mod's jar on Modrinth) and the paths to take from it. The game downloads it when the mod is first turned on, checks the hash, and reads those assets from its cache. ## Why Many mods license their code and their assets differently. Create's code is MIT, so it can be ported; its textures, models and sounds are All Rights Reserved, so a port cannot ship them. Fetching them from the mod's own official download on the player's machine keeps the port lawful and the .hmod small. On main the launcher's mod browser can download a Modrinth jar and port it (`horizon-port-pack`), but an .hmod cannot name remote assets, and nothing does it in game or for a server's players. ## Proposal - In `horizon-mod.toml`: `[[assets.fetch]] url = "https://cdn.modrinth.com/..."`, `sha512 = "..."`, `size = ...`, `take = ["assets/create/**"]`. - Downloaded once into a cache keyed by the hash, refused on a hash or size mismatch, with progress shown on the loading screen; a mod whose files are missing and cannot be fetched loads without them and says so. - Only hosts the player's own launcher or game already trusts (Modrinth's CDN, maybe CurseForge's), so a mod cannot point the game anywhere. This is the form my fork uses (a manifest entry, not a hook); the exact implementation is open to change. ## How I did it on my fork My fork has this as `[assets.fetch]`: `horizon-mods/src/fetch.rs` and `game/mod_assets.rs` ([bd887b2d4](https://github.com/JuanLuci/starling/commit/bd887b2d4)). My Create port fetches the 19 MB Create jar from Modrinth on first use and reads the assets from it.
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#1733
No description provided.