[PR #3641] [MERGED] resource packs: a zip that stores pack.mcmeta as pack.mcmeta/ loads, as ZipFile.getEntry finds it #5117

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3641
Author: @iLostName
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: pack-mcmeta-folder-entry


📝 Commits (1)

  • 88a001b resource packs: a zip that stores pack.mcmeta as pack.mcmeta/ loads, as ZipFile.getEntry finds it

📊 Changes

1 file changed (+61 additions, -15 deletions)

View changed files

📝 crates/horizon-client-render/src/zip.rs (+61 -15)

📄 Description

What and why

Loka (lokamc.com) serves a resource pack whose zip names its metadata pack.mcmeta/ (and its icon pack.png/). Horizon skipped every zip entry ending in /, found no pack.mcmeta, and disconnected with "The resource pack reload failed". Zip lookups now fall back to the folder entry name/ when no file has the name, as Java does, so the pack loads as in vanilla (checked with the real LokaPack.zip). Fixes #3413.

Vanilla reference

FilePackResources.getResource reads through ZipFile.getEntry, which (since JDK 9) returns the folder entry name/ when no entry has the exact name; getInputStream reads its bytes like a file's. listResources still skips folder entries.

Self-check

pr_ready (tools/pr_ready.py --quick on PC-Lost, against origin/main at 64990cd32, 3 min 28 s)

Check Result
Scope ✅ 1 files, +61 −15
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 408 run, FAILED (failures=1, skipped=12) (1 min 9 s)
rustfmt ✅ (11 s)
clippy ✅ (1 min 4 s)
tests: horizon-client-render ✅ 498 passed (46 s)
doc tests ✅ 0 passed (14 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)

The one failure under Python tests is test_port_publish.PublishTests.test_body_has_names_and_signatures_only, a ~/ against ~\ path check that fails on Windows on main too. Parity is left to CI.


🔄 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/3641 **Author:** [@iLostName](https://github.com/iLostName) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `pack-mcmeta-folder-entry` --- ### 📝 Commits (1) - [`88a001b`](https://github.com/horizon-rust/horizon/commit/88a001b7fa29f30d60384efda09dc51b86e1ba9a) resource packs: a zip that stores pack.mcmeta as pack.mcmeta/ loads, as ZipFile.getEntry finds it ### 📊 Changes **1 file changed** (+61 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/zip.rs` (+61 -15) </details> ### 📄 Description ## What and why Loka (lokamc.com) serves a resource pack whose zip names its metadata `pack.mcmeta/` (and its icon `pack.png/`). Horizon skipped every zip entry ending in `/`, found no `pack.mcmeta`, and disconnected with "The resource pack reload failed". Zip lookups now fall back to the folder entry `name/` when no file has the name, as Java does, so the pack loads as in vanilla (checked with the real `LokaPack.zip`). Fixes #3413. ## Vanilla reference `FilePackResources.getResource` reads through `ZipFile.getEntry`, which (since JDK 9) returns the folder entry `name/` when no entry has the exact name; `getInputStream` reads its bytes like a file's. `listResources` still skips folder entries. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on PC-Lost, against origin/main at 64990cd32, 3 min 28 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +61 −15 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 408 run, FAILED (failures=1, skipped=12) (1 min 9 s) | | rustfmt | ✅ (11 s) | | clippy | ✅ (1 min 4 s) | | tests: horizon-client-render | ✅ 498 passed (46 s) | | doc tests | ✅ 0 passed (14 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) | The one failure under Python tests is `test_port_publish.PublishTests.test_body_has_names_and_signatures_only`, a `~/` against `~\` path check that fails on Windows on main too. Parity is left to CI. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:10:21 +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#5117
No description provided.