[PR #957] [MERGED] Carry: read data files with comments, as Minecraft does #2939

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/957
Author: @ludovic111
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @ludovic111

Base: main ← Head: fix/carry-json-comments


📝 Commits (1)

  • bb3ec12 Carry: read data files with comments, as Minecraft does

📊 Changes

1 file changed (+86 additions, -1 deletions)

View changed files

📝 crates/horizon-port-pack/src/carry.rs (+86 -1)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

Minecraft reads data files with Gson's lenient reader, which accepts //, # and /* */ comments. Some mods ship such files: 6 of Better Nether Fortresses' template pools have comments. Carry read them strictly, called them unreadable and left them out, so the fortress lost most of its pools. Now carry strips the comments outside strings (honouring escapes), reads the file, and writes it back as plain JSON.

Proof (ATM10's carried mods, seed 1234)

  • Better Fortresses (Nether, chunks -64..63): 7 starts with 265 pieces before, 3,765 pieces now.
  • Better Jungle Temples (chunks -256..255): 170 → 196 pieces.
  • With the pools loading, Better Fortresses reports the YUNG rules it still loses (piece_in_range, dead-end pools, modifiers); #959 carries them.
  • New test reads_json_with_comments_as_minecraft_does.

Self-check

cargo fmt --all --check                                   ok
cargo clippy --workspace --all-targets -- -D warnings     ok
cargo test -p horizon-port-pack                           ok

No game code here.

Nothing needs Ludovic.

🤖 Generated with Claude Code


🔄 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/957 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/carry-json-comments` --- ### 📝 Commits (1) - [`bb3ec12`](https://github.com/horizon-rust/horizon/commit/bb3ec12ed07e71d8b4563a93c1cf86c72608fbea) Carry: read data files with comments, as Minecraft does ### 📊 Changes **1 file changed** (+86 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-port-pack/src/carry.rs` (+86 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Minecraft reads data files with Gson's lenient reader, which accepts `//`, `#` and `/* */` comments. Some mods ship such files: 6 of Better Nether Fortresses' template pools have comments. Carry read them strictly, called them unreadable and left them out, so the fortress lost most of its pools. Now carry strips the comments outside strings (honouring escapes), reads the file, and writes it back as plain JSON. ## Proof (ATM10's carried mods, seed 1234) - Better Fortresses (Nether, chunks -64..63): 7 starts with 265 pieces before, 3,765 pieces now. - Better Jungle Temples (chunks -256..255): 170 → 196 pieces. - With the pools loading, Better Fortresses reports the YUNG rules it still loses (`piece_in_range`, dead-end pools, modifiers); #959 carries them. - New test `reads_json_with_comments_as_minecraft_does`. ## Self-check ``` cargo fmt --all --check ok cargo clippy --workspace --all-targets -- -D warnings ok cargo test -p horizon-port-pack ok ``` No game code here. Nothing needs Ludovic. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 16:00:16 +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#2939
No description provided.