[PR #4475] [MERGED] feat(mods): native mods get the game's config folder #5644

Closed
opened 2026-11-03 05:14:01 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4475
Author: @reservedbytes
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @levzzz5154

Base: main ← Head: feat/native-config-dir


📝 Commits (2)

  • 2d0c6e9 feat(mods): native mods get the game's config folder
  • eda9860 Merge hr/main; renumber native config folder to API 26

📊 Changes

3 files changed (+53 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/native_hooks.rs (+44 -2)
📝 docs/mods.md (+5 -0)
📝 docs/native-mods.md (+4 -0)

📄 Description

What and why

Native mods have no standard place for config files
Settings are one file per key in horizon-mods/.horizon-mod-data/<id>/, fine for a toggle, but a mod ported from Java reads and writes its own config/<name>.json

Game::native_config_dir() gives the game's config/ folder beside options.txt, shared by every mod like on Fabric and NeoForge, so a mod picks its own file names (config/farmersdelight-common.json)
It takes no self, so it works from any hook, the level's too
It makes the folder when it's missing, and an error names the folder
Same folder on the window, its server thread and a LAN host

On a dedicated server it's beside server.properties
Both are relative to the working folder (dedicated.rs reads server.properties from there too), and horizon-server and the launcher start the server in its own folder, so the two always sit together

Settings stay where they were

This bumps the hook points API to 23 (renumbered at merge if needed)

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Self-check

Check Result
Scope ✅ 3 files, +53 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 481 passed (59 s)
rustfmt ✅ (9 s)
clippy ✅ (3 min 44 s)
tests: horizon-client ✅ 1208 passed (2 min 51 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/4475 **Author:** [@reservedbytes](https://github.com/reservedbytes) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `feat/native-config-dir` --- ### 📝 Commits (2) - [`2d0c6e9`](https://github.com/horizon-rust/horizon/commit/2d0c6e984f0fee29cb8e7fa1a9e404a7e8572519) feat(mods): native mods get the game's config folder - [`eda9860`](https://github.com/horizon-rust/horizon/commit/eda9860e1d460e8e86340305d9e733fa59252471) Merge hr/main; renumber native config folder to API 26 ### 📊 Changes **3 files changed** (+53 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/native_hooks.rs` (+44 -2) 📝 `docs/mods.md` (+5 -0) 📝 `docs/native-mods.md` (+4 -0) </details> ### 📄 Description ## What and why Native mods have no standard place for config files Settings are one file per key in `horizon-mods/.horizon-mod-data/<id>/`, fine for a toggle, but a mod ported from Java reads and writes its own `config/<name>.json` `Game::native_config_dir()` gives the game's `config/` folder beside `options.txt`, shared by every mod like on Fabric and NeoForge, so a mod picks its own file names (`config/farmersdelight-common.json`) It takes no `self`, so it works from any hook, the level's too It makes the folder when it's missing, and an error names the folder Same folder on the window, its server thread and a LAN host On a dedicated server it's beside `server.properties` Both are relative to the working folder (`dedicated.rs` reads `server.properties` from there too), and `horizon-server` and the launcher start the server in its own folder, so the two always sit together Settings stay where they were This bumps the hook points API to 23 (renumbered at merge if needed) ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [x] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Self-check | Check | Result | | --- | --- | | Scope | ✅ 3 files, +53 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 481 passed (59 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (3 min 44 s) | | tests: horizon-client | ✅ 1208 passed (2 min 51 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:14:01 +07:00
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#5644
No description provided.