[PR #4975] [CLOSED] Data packs: /datapack follows the world's enabled features #5983

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4975
Author: @masa-masa-0314
Created: 10/31/2026
Status: ❌ Closed

Base: main ← Head: feat/datapack-flag-gate


📝 Commits (10+)

  • a3dc4c7 Biomes: the palette holds a world's biomes too
  • d2145ac Commands: a world's packs complete and match their biomes and tags
  • 4885673 Data packs: the world's chunks and the game read one biome table
  • 6eada86 Data packs: one pack list builds the biomes, the worldgen and the commands
  • 34be912 Biomes: the table survives world switches, and tags nest
  • 69cc8ab Merge remote-tracking branch 'origin/main' into pr-4577
  • 9950e27 Fix packed_biomes call after merging main; restore world_worldgen_overrides's doc comment
  • a5d6d8a Biomes: the palette holds a world's biomes too
  • ce83c14 Commands: a world's packs complete and match their biomes and tags
  • 6ea12f7 Data packs: the world's chunks and the game read one biome table

📊 Changes

35 files changed (+1545 additions, -159 deletions)

View changed files

📝 crates/horizon-client-render/src/chunk.rs (+1 -1)
📝 crates/horizon-client-render/src/datapack.rs (+133 -10)
📝 crates/horizon-client/src/game.rs (+149 -6)
📝 crates/horizon-client/src/game/commands.rs (+24 -7)
📝 crates/horizon-client/src/game/commands/execute.rs (+12 -24)
📝 crates/horizon-client/src/game/commands/terrain_cmds.rs (+6 -2)
📝 crates/horizon-client/src/game/creatures.rs (+2 -2)
📝 crates/horizon-client/src/game/dedicated.rs (+1 -1)
📝 crates/horizon-client/src/game/dispense_fixture.rs (+1 -1)
📝 crates/horizon-client/src/game/fishing.rs (+1 -1)
📝 crates/horizon-client/src/game/functions.rs (+72 -30)
📝 crates/horizon-client/src/game/initial_spawn.rs (+1 -1)
📝 crates/horizon-client/src/game/integrated.rs (+9 -0)
📝 crates/horizon-client/src/game/lan.rs (+4 -3)
📝 crates/horizon-client/src/game/moving_pistons.rs (+1 -1)
📝 crates/horizon-client/src/game/music.rs (+1 -1)
📝 crates/horizon-client/src/game/natural_spawning.rs (+1 -1)
📝 crates/horizon-client/src/game/nether_portal.rs (+11 -9)
📝 crates/horizon-client/src/game/options.rs (+2 -1)
📝 crates/horizon-client/src/game/passengers.rs (+1 -1)

...and 15 more files

📄 Description

🤖 Opened by masa-masa-0314's AI agent (ZCode), not by masa-masa-0314 personally.

What and why

DataPackCommand gates feature packs on the world's flags: a pack whose requested features are not enabled is not listed as available, cannot be enabled (commands.datapack.enable.failed.no_flags, naming the missing flags), and a feature pack can never be disabled (commands.datapack.disable.failed.feature) — the flag stays on for the world's life. Horizon refused every enable unconditionally and allowed every disable. The command reads the world's enabled_features (#4957) now: with the flag on, a feature pack enables and its data files load through the pack stack; without it, it stays hidden and the refusal names the missing flag.

Stacked on #4957 (← #4948 ← #4619 ← #4577).

Vanilla reference

Decompiled from the 26.3 client jar: DataPackCommand — the enable/available filters on pack.getRequestedFeatures().isSubsetOf(enabledFeatures), ERROR_CANNOT_DISABLE_FEATURE for PackSource.FEATURE packs with requested features, and the two error keys' arguments.

Self-check

rustfmt ✅, clippy -D warnings ✅, tests ✅ (client 906, render 688, world 227). Headless probe, both directions: a world whose level.dat enables minecraft:trade_rebalance accepts /datapack enable trade_rebalance ("Enabling data pack [trade_rebalance (feature)]", then listed enabled) while a world without the flag hides the feature packs from available and refuses the enable with the missing flag named.

Screenshots

Not needed (command output shown above).


🔄 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/4975 **Author:** [@masa-masa-0314](https://github.com/masa-masa-0314) **Created:** 10/31/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/datapack-flag-gate` --- ### 📝 Commits (10+) - [`a3dc4c7`](https://github.com/horizon-rust/horizon/commit/a3dc4c74abe425c47ed6a41336bcc61bda4d5a45) Biomes: the palette holds a world's biomes too - [`d2145ac`](https://github.com/horizon-rust/horizon/commit/d2145ac8205ad3b44e6cbc3d37002cf433d4bcd6) Commands: a world's packs complete and match their biomes and tags - [`4885673`](https://github.com/horizon-rust/horizon/commit/48856738b0d12ad9e283fc535eb3d702ba3816f1) Data packs: the world's chunks and the game read one biome table - [`6eada86`](https://github.com/horizon-rust/horizon/commit/6eada864b195708527f9445822568bb5d1f482f5) Data packs: one pack list builds the biomes, the worldgen and the commands - [`34be912`](https://github.com/horizon-rust/horizon/commit/34be9125df8c2e2a49d3ee9873c56e2bbeefb811) Biomes: the table survives world switches, and tags nest - [`69cc8ab`](https://github.com/horizon-rust/horizon/commit/69cc8ab35b302cec2bb1420814909a0804ea2bab) Merge remote-tracking branch 'origin/main' into pr-4577 - [`9950e27`](https://github.com/horizon-rust/horizon/commit/9950e27f87d7efd8f589be401a1be5b04c5fc76f) Fix packed_biomes call after merging main; restore world_worldgen_overrides's doc comment - [`a5d6d8a`](https://github.com/horizon-rust/horizon/commit/a5d6d8af2aed8c015e85fa976f58ac9ee212a8bd) Biomes: the palette holds a world's biomes too - [`ce83c14`](https://github.com/horizon-rust/horizon/commit/ce83c14926968888e8386c8481150de5be7307ae) Commands: a world's packs complete and match their biomes and tags - [`6ea12f7`](https://github.com/horizon-rust/horizon/commit/6ea12f710f6a76c68eef7077da5b1bc8d81b57aa) Data packs: the world's chunks and the game read one biome table ### 📊 Changes **35 files changed** (+1545 additions, -159 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/chunk.rs` (+1 -1) 📝 `crates/horizon-client-render/src/datapack.rs` (+133 -10) 📝 `crates/horizon-client/src/game.rs` (+149 -6) 📝 `crates/horizon-client/src/game/commands.rs` (+24 -7) 📝 `crates/horizon-client/src/game/commands/execute.rs` (+12 -24) 📝 `crates/horizon-client/src/game/commands/terrain_cmds.rs` (+6 -2) 📝 `crates/horizon-client/src/game/creatures.rs` (+2 -2) 📝 `crates/horizon-client/src/game/dedicated.rs` (+1 -1) 📝 `crates/horizon-client/src/game/dispense_fixture.rs` (+1 -1) 📝 `crates/horizon-client/src/game/fishing.rs` (+1 -1) 📝 `crates/horizon-client/src/game/functions.rs` (+72 -30) 📝 `crates/horizon-client/src/game/initial_spawn.rs` (+1 -1) 📝 `crates/horizon-client/src/game/integrated.rs` (+9 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+4 -3) 📝 `crates/horizon-client/src/game/moving_pistons.rs` (+1 -1) 📝 `crates/horizon-client/src/game/music.rs` (+1 -1) 📝 `crates/horizon-client/src/game/natural_spawning.rs` (+1 -1) 📝 `crates/horizon-client/src/game/nether_portal.rs` (+11 -9) 📝 `crates/horizon-client/src/game/options.rs` (+2 -1) 📝 `crates/horizon-client/src/game/passengers.rs` (+1 -1) _...and 15 more files_ </details> ### 📄 Description > 🤖 Opened by masa-masa-0314's AI agent (ZCode), not by masa-masa-0314 personally. ## What and why `DataPackCommand` gates feature packs on the world's flags: a pack whose requested features are not enabled is not listed as available, cannot be enabled (`commands.datapack.enable.failed.no_flags`, naming the missing flags), and a feature pack can never be disabled (`commands.datapack.disable.failed.feature`) — the flag stays on for the world's life. Horizon refused every enable unconditionally and allowed every disable. The command reads the world's `enabled_features` (#4957) now: with the flag on, a feature pack enables and its data files load through the pack stack; without it, it stays hidden and the refusal names the missing flag. Stacked on #4957 (← #4948 ← #4619 ← #4577). ## Vanilla reference Decompiled from the 26.3 client jar: `DataPackCommand` — the enable/available filters on `pack.getRequestedFeatures().isSubsetOf(enabledFeatures)`, `ERROR_CANNOT_DISABLE_FEATURE` for `PackSource.FEATURE` packs with requested features, and the two error keys' arguments. ## Self-check rustfmt ✅, clippy `-D warnings` ✅, tests ✅ (client 906, render 688, world 227). Headless probe, both directions: a world whose level.dat enables `minecraft:trade_rebalance` accepts `/datapack enable trade_rebalance` ("Enabling data pack [trade_rebalance (feature)]", then listed enabled) while a world without the flag hides the feature packs from `available` and refuses the enable with the missing flag named. ## Screenshots Not needed (command output shown above). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:16:24 +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#5983
No description provided.