Skip to content

Commit

Permalink
Added advancements fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Lianecx committed Oct 19, 2024
1 parent a537bdc commit 956d572
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ module.exports.legacy = {
}

const schemas = {
advancements: require('./minecraft-data/schemas/advancements_schema.json'),
biomes: require('./minecraft-data/schemas/biomes_schema.json'),
blocks: require('./minecraft-data/schemas/blocks_schema.json'),
effects: require('./minecraft-data/schemas/effects_schema.json'),
Expand Down
3 changes: 2 additions & 1 deletion lib/indexes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module.exports = function (mcData) {
}

return {
advancementsByName: indexer.buildIndexFromArray(mcData.advancements, 'name'),

biomesById: indexer.buildIndexFromArray(mcData.biomes, 'id'),
biomesByName: indexer.buildIndexFromArray(mcData.biomes, 'name'),

Expand Down Expand Up @@ -59,6 +61,5 @@ module.exports = function (mcData) {

soundsById: mcData.sounds === undefined ? undefined : indexer.buildIndexFromArray(mcData.sounds, 'id'),
soundsByName: mcData.sounds === undefined ? undefined : indexer.buildIndexFromArray(mcData.sounds, 'name')

}
}
2 changes: 2 additions & 0 deletions lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module.exports = mcDataToNode
function mcDataToNode (mcData) {
const indexes = require('./indexes.js')(mcData)
return {
advancements: indexes.advancementsByName,

blocks: indexes.blocksById,
blocksByName: indexes.blocksByName,
blocksArray: mcData.blocks,
Expand Down

0 comments on commit 956d572

Please sign in to comment.