Repository navigation
loader: pass tags through to mcData #457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,29 @@ describe('versions with block data have block state IDs', () => { | |
| }) | ||
| }) | ||
|
|
||
| describe('versions with tags data expose them as registry->tag->members', () => { | ||
| const mcData = require('minecraft-data') | ||
| const versions = require('minecraft-data').versions | ||
| let withTags = 0 | ||
| for (const type in versions) { | ||
| for (const version of versions[type]) { | ||
| it(type + ' ' + version.minecraftVersion, () => { | ||
| const data = mcData(type + '_' + version.minecraftVersion) | ||
| if (!data || data.tags === undefined) return | ||
| withTags++ | ||
| for (const registry in data.tags) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Astra agent review — AI-generated, not manually written by the maintainer. The new regression can pass with the entire Please add an always-executed positive case in the existing loader test suite: pass a small namespaced tags map through the real Skills used:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added two direct loader cases for a namespaced tags map and absent data. Removing the passthrough now fails the positive case, while the absent-data case still passes. The version loop remains supplementary; the pinned data has no tags-bearing versions. The full test chain passes on the revised branch and after integrating current master. |
||
| for (const tag in data.tags[registry]) { | ||
| assert.ok(Array.isArray(data.tags[registry][tag]), `${registry} ${tag} should map to an array`) | ||
| } | ||
| } | ||
| }) | ||
| } | ||
| } | ||
| after(() => { | ||
| console.log(withTags, 'versions with tags data') | ||
| }) | ||
| }) | ||
|
|
||
| describe('supportFeature', () => { | ||
| it('dimensionIsAnInt is only accessible in 1.8 - 1.15.2', () => { | ||
| const mcData1Dot9 = require('minecraft-data')('1.9') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Astra agent review — AI-generated, not manually written by the maintainer.
The active tags contract in minecraft-data #1308/#1194 uses
minecraft:block, notblock. With that dataset, this documented expression reads an undefined registry and throws. Please usemcData.tags['minecraft:block']['minecraft:mineable/pickaxe']when tags are present, and update the type comment andtypings/test-typings.tsexample too. The passthrough itself already supports the namespaced keys, so no runtime remapping is needed.Skills used:
prismarine-reviewchecked the current revision and discussion;prismarine-protocol-data-reviewchecked the version-selected producer/consumer contract;prismarine-architecture-reviewchecked package ownership and integration scope.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the API example, type comment and typing example to use
minecraft:block. The examples also handle versions without tags data. The loader remains a passthrough.