From 956d5727277344ad3e54318c5ce65c038c8e7bb0 Mon Sep 17 00:00:00 2001 From: Lianecx <84291452+Lianecx@users.noreply.github.com> Date: Sat, 19 Oct 2024 13:43:41 +0200 Subject: [PATCH] Added advancements fields --- index.js | 1 + lib/indexes.js | 3 ++- lib/loader.js | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 526dba1c..d19fe631 100644 --- a/index.js +++ b/index.js @@ -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'), diff --git a/lib/indexes.js b/lib/indexes.js index 024df2c6..4482f221 100644 --- a/lib/indexes.js +++ b/lib/indexes.js @@ -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'), @@ -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') - } } diff --git a/lib/loader.js b/lib/loader.js index e8771668..b6d4d635 100644 --- a/lib/loader.js +++ b/lib/loader.js @@ -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,