From f4ead94a90f775a99132ead16aa1ccf1bfde4e80 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 24 Jun 2024 12:55:49 +0200 Subject: generate nbt files programmatically --- .../structure/trail_ruins/tower/tower_1.nbt | Bin 237 -> 233 bytes .../structure/trail_ruins/tower/tower_2.nbt | Bin 237 -> 233 bytes .../structure/trail_ruins/tower/tower_5.nbt | Bin 233 -> 237 bytes .../desert/town_centers/desert_meeting_point_1.nbt | Bin 0 -> 10278 bytes .../desert/town_centers/desert_meeting_point_2.nbt | Bin 0 -> 10278 bytes .../desert/town_centers/desert_meeting_point_3.nbt | Bin 0 -> 10278 bytes .../zombie/town_centers/desert_meeting_point_1.nbt | Bin 0 -> 10278 bytes .../zombie/town_centers/desert_meeting_point_2.nbt | Bin 0 -> 10278 bytes .../zombie/town_centers/desert_meeting_point_3.nbt | Bin 0 -> 10278 bytes .../plains/town_centers/plains_fountain_01.nbt | Bin 0 -> 10278 bytes .../plains/town_centers/plains_meeting_point_1.nbt | Bin 0 -> 10278 bytes .../plains/town_centers/plains_meeting_point_2.nbt | Bin 0 -> 10278 bytes .../plains/town_centers/plains_meeting_point_3.nbt | Bin 0 -> 10278 bytes .../zombie/town_centers/plains_fountain_01.nbt | Bin 0 -> 10278 bytes .../zombie/town_centers/plains_meeting_point_1.nbt | Bin 0 -> 10278 bytes .../zombie/town_centers/plains_meeting_point_2.nbt | Bin 0 -> 10278 bytes .../zombie/town_centers/plains_meeting_point_3.nbt | Bin 0 -> 10278 bytes .../town_centers/savanna_meeting_point_1.nbt | Bin 0 -> 10278 bytes .../town_centers/savanna_meeting_point_2.nbt | Bin 0 -> 10278 bytes .../town_centers/savanna_meeting_point_3.nbt | Bin 0 -> 10278 bytes .../town_centers/savanna_meeting_point_4.nbt | Bin 0 -> 10278 bytes .../town_centers/savanna_meeting_point_1.nbt | Bin 0 -> 10278 bytes .../town_centers/savanna_meeting_point_2.nbt | Bin 0 -> 10278 bytes .../town_centers/savanna_meeting_point_3.nbt | Bin 0 -> 10278 bytes .../town_centers/savanna_meeting_point_4.nbt | Bin 0 -> 10278 bytes .../snowy/town_centers/snowy_meeting_point_1.nbt | Bin 0 -> 10278 bytes .../snowy/town_centers/snowy_meeting_point_2.nbt | Bin 0 -> 10278 bytes .../snowy/town_centers/snowy_meeting_point_3.nbt | Bin 0 -> 10278 bytes .../zombie/town_centers/snowy_meeting_point_1.nbt | Bin 0 -> 10278 bytes .../zombie/town_centers/snowy_meeting_point_2.nbt | Bin 0 -> 10278 bytes .../zombie/town_centers/snowy_meeting_point_3.nbt | Bin 0 -> 10278 bytes .../taiga/town_centers/taiga_meeting_point_1.nbt | Bin 0 -> 10278 bytes .../taiga/town_centers/taiga_meeting_point_2.nbt | Bin 0 -> 10278 bytes .../zombie/town_centers/taiga_meeting_point_1.nbt | Bin 0 -> 10278 bytes .../zombie/town_centers/taiga_meeting_point_2.nbt | Bin 0 -> 10278 bytes data/vanilla_skyblock/structure/empty.nbt | 0 index.js | 134 +++++++++++++++++++-- 37 files changed, 126 insertions(+), 8 deletions(-) create mode 100644 data/minecraft/structure/village/desert/town_centers/desert_meeting_point_1.nbt create mode 100644 data/minecraft/structure/village/desert/town_centers/desert_meeting_point_2.nbt create mode 100644 data/minecraft/structure/village/desert/town_centers/desert_meeting_point_3.nbt create mode 100644 data/minecraft/structure/village/desert/zombie/town_centers/desert_meeting_point_1.nbt create mode 100644 data/minecraft/structure/village/desert/zombie/town_centers/desert_meeting_point_2.nbt create mode 100644 data/minecraft/structure/village/desert/zombie/town_centers/desert_meeting_point_3.nbt create mode 100644 data/minecraft/structure/village/plains/town_centers/plains_fountain_01.nbt create mode 100644 data/minecraft/structure/village/plains/town_centers/plains_meeting_point_1.nbt create mode 100644 data/minecraft/structure/village/plains/town_centers/plains_meeting_point_2.nbt create mode 100644 data/minecraft/structure/village/plains/town_centers/plains_meeting_point_3.nbt create mode 100644 data/minecraft/structure/village/plains/zombie/town_centers/plains_fountain_01.nbt create mode 100644 data/minecraft/structure/village/plains/zombie/town_centers/plains_meeting_point_1.nbt create mode 100644 data/minecraft/structure/village/plains/zombie/town_centers/plains_meeting_point_2.nbt create mode 100644 data/minecraft/structure/village/plains/zombie/town_centers/plains_meeting_point_3.nbt create mode 100644 data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_1.nbt create mode 100644 data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_2.nbt create mode 100644 data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_3.nbt create mode 100644 data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_4.nbt create mode 100644 data/minecraft/structure/village/snowy/town_centers/snowy_meeting_point_1.nbt create mode 100644 data/minecraft/structure/village/snowy/town_centers/snowy_meeting_point_2.nbt create mode 100644 data/minecraft/structure/village/snowy/town_centers/snowy_meeting_point_3.nbt create mode 100644 data/minecraft/structure/village/snowy/zombie/town_centers/snowy_meeting_point_1.nbt create mode 100644 data/minecraft/structure/village/snowy/zombie/town_centers/snowy_meeting_point_2.nbt create mode 100644 data/minecraft/structure/village/snowy/zombie/town_centers/snowy_meeting_point_3.nbt create mode 100644 data/minecraft/structure/village/taiga/zombie/town_centers/taiga_meeting_point_1.nbt create mode 100644 data/minecraft/structure/village/taiga/zombie/town_centers/taiga_meeting_point_2.nbt create mode 100644 data/vanilla_skyblock/structure/empty.nbt diff --git a/data/minecraft/structure/trail_ruins/tower/tower_1.nbt b/data/minecraft/structure/trail_ruins/tower/tower_1.nbt index 7537513..1ebd680 100644 Binary files a/data/minecraft/structure/trail_ruins/tower/tower_1.nbt and b/data/minecraft/structure/trail_ruins/tower/tower_1.nbt differ diff --git a/data/minecraft/structure/trail_ruins/tower/tower_2.nbt b/data/minecraft/structure/trail_ruins/tower/tower_2.nbt index 7537513..1ebd680 100644 Binary files a/data/minecraft/structure/trail_ruins/tower/tower_2.nbt and b/data/minecraft/structure/trail_ruins/tower/tower_2.nbt differ diff --git a/data/minecraft/structure/trail_ruins/tower/tower_5.nbt b/data/minecraft/structure/trail_ruins/tower/tower_5.nbt index 1ebd680..7537513 100644 Binary files a/data/minecraft/structure/trail_ruins/tower/tower_5.nbt and b/data/minecraft/structure/trail_ruins/tower/tower_5.nbt differ diff --git a/data/minecraft/structure/village/desert/town_centers/desert_meeting_point_1.nbt b/data/minecraft/structure/village/desert/town_centers/desert_meeting_point_1.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/desert/town_centers/desert_meeting_point_1.nbt differ diff --git a/data/minecraft/structure/village/desert/town_centers/desert_meeting_point_2.nbt b/data/minecraft/structure/village/desert/town_centers/desert_meeting_point_2.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/desert/town_centers/desert_meeting_point_2.nbt differ diff --git a/data/minecraft/structure/village/desert/town_centers/desert_meeting_point_3.nbt b/data/minecraft/structure/village/desert/town_centers/desert_meeting_point_3.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/desert/town_centers/desert_meeting_point_3.nbt differ diff --git a/data/minecraft/structure/village/desert/zombie/town_centers/desert_meeting_point_1.nbt b/data/minecraft/structure/village/desert/zombie/town_centers/desert_meeting_point_1.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/desert/zombie/town_centers/desert_meeting_point_1.nbt differ diff --git a/data/minecraft/structure/village/desert/zombie/town_centers/desert_meeting_point_2.nbt b/data/minecraft/structure/village/desert/zombie/town_centers/desert_meeting_point_2.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/desert/zombie/town_centers/desert_meeting_point_2.nbt differ diff --git a/data/minecraft/structure/village/desert/zombie/town_centers/desert_meeting_point_3.nbt b/data/minecraft/structure/village/desert/zombie/town_centers/desert_meeting_point_3.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/desert/zombie/town_centers/desert_meeting_point_3.nbt differ diff --git a/data/minecraft/structure/village/plains/town_centers/plains_fountain_01.nbt b/data/minecraft/structure/village/plains/town_centers/plains_fountain_01.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/plains/town_centers/plains_fountain_01.nbt differ diff --git a/data/minecraft/structure/village/plains/town_centers/plains_meeting_point_1.nbt b/data/minecraft/structure/village/plains/town_centers/plains_meeting_point_1.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/plains/town_centers/plains_meeting_point_1.nbt differ diff --git a/data/minecraft/structure/village/plains/town_centers/plains_meeting_point_2.nbt b/data/minecraft/structure/village/plains/town_centers/plains_meeting_point_2.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/plains/town_centers/plains_meeting_point_2.nbt differ diff --git a/data/minecraft/structure/village/plains/town_centers/plains_meeting_point_3.nbt b/data/minecraft/structure/village/plains/town_centers/plains_meeting_point_3.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/plains/town_centers/plains_meeting_point_3.nbt differ diff --git a/data/minecraft/structure/village/plains/zombie/town_centers/plains_fountain_01.nbt b/data/minecraft/structure/village/plains/zombie/town_centers/plains_fountain_01.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/plains/zombie/town_centers/plains_fountain_01.nbt differ diff --git a/data/minecraft/structure/village/plains/zombie/town_centers/plains_meeting_point_1.nbt b/data/minecraft/structure/village/plains/zombie/town_centers/plains_meeting_point_1.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/plains/zombie/town_centers/plains_meeting_point_1.nbt differ diff --git a/data/minecraft/structure/village/plains/zombie/town_centers/plains_meeting_point_2.nbt b/data/minecraft/structure/village/plains/zombie/town_centers/plains_meeting_point_2.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/plains/zombie/town_centers/plains_meeting_point_2.nbt differ diff --git a/data/minecraft/structure/village/plains/zombie/town_centers/plains_meeting_point_3.nbt b/data/minecraft/structure/village/plains/zombie/town_centers/plains_meeting_point_3.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/plains/zombie/town_centers/plains_meeting_point_3.nbt differ diff --git a/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_1.nbt b/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_1.nbt index e69de29..3eddcb6 100644 Binary files a/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_1.nbt and b/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_1.nbt differ diff --git a/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_2.nbt b/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_2.nbt index e69de29..3eddcb6 100644 Binary files a/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_2.nbt and b/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_2.nbt differ diff --git a/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_3.nbt b/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_3.nbt index e69de29..3eddcb6 100644 Binary files a/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_3.nbt and b/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_3.nbt differ diff --git a/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_4.nbt b/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_4.nbt index e69de29..3eddcb6 100644 Binary files a/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_4.nbt and b/data/minecraft/structure/village/savanna/town_centers/savanna_meeting_point_4.nbt differ diff --git a/data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_1.nbt b/data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_1.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_1.nbt differ diff --git a/data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_2.nbt b/data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_2.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_2.nbt differ diff --git a/data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_3.nbt b/data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_3.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_3.nbt differ diff --git a/data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_4.nbt b/data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_4.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/savanna/zombie/town_centers/savanna_meeting_point_4.nbt differ diff --git a/data/minecraft/structure/village/snowy/town_centers/snowy_meeting_point_1.nbt b/data/minecraft/structure/village/snowy/town_centers/snowy_meeting_point_1.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/snowy/town_centers/snowy_meeting_point_1.nbt differ diff --git a/data/minecraft/structure/village/snowy/town_centers/snowy_meeting_point_2.nbt b/data/minecraft/structure/village/snowy/town_centers/snowy_meeting_point_2.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/snowy/town_centers/snowy_meeting_point_2.nbt differ diff --git a/data/minecraft/structure/village/snowy/town_centers/snowy_meeting_point_3.nbt b/data/minecraft/structure/village/snowy/town_centers/snowy_meeting_point_3.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/snowy/town_centers/snowy_meeting_point_3.nbt differ diff --git a/data/minecraft/structure/village/snowy/zombie/town_centers/snowy_meeting_point_1.nbt b/data/minecraft/structure/village/snowy/zombie/town_centers/snowy_meeting_point_1.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/snowy/zombie/town_centers/snowy_meeting_point_1.nbt differ diff --git a/data/minecraft/structure/village/snowy/zombie/town_centers/snowy_meeting_point_2.nbt b/data/minecraft/structure/village/snowy/zombie/town_centers/snowy_meeting_point_2.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/snowy/zombie/town_centers/snowy_meeting_point_2.nbt differ diff --git a/data/minecraft/structure/village/snowy/zombie/town_centers/snowy_meeting_point_3.nbt b/data/minecraft/structure/village/snowy/zombie/town_centers/snowy_meeting_point_3.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/snowy/zombie/town_centers/snowy_meeting_point_3.nbt differ diff --git a/data/minecraft/structure/village/taiga/town_centers/taiga_meeting_point_1.nbt b/data/minecraft/structure/village/taiga/town_centers/taiga_meeting_point_1.nbt index e69de29..3eddcb6 100644 Binary files a/data/minecraft/structure/village/taiga/town_centers/taiga_meeting_point_1.nbt and b/data/minecraft/structure/village/taiga/town_centers/taiga_meeting_point_1.nbt differ diff --git a/data/minecraft/structure/village/taiga/town_centers/taiga_meeting_point_2.nbt b/data/minecraft/structure/village/taiga/town_centers/taiga_meeting_point_2.nbt index e69de29..3eddcb6 100644 Binary files a/data/minecraft/structure/village/taiga/town_centers/taiga_meeting_point_2.nbt and b/data/minecraft/structure/village/taiga/town_centers/taiga_meeting_point_2.nbt differ diff --git a/data/minecraft/structure/village/taiga/zombie/town_centers/taiga_meeting_point_1.nbt b/data/minecraft/structure/village/taiga/zombie/town_centers/taiga_meeting_point_1.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/taiga/zombie/town_centers/taiga_meeting_point_1.nbt differ diff --git a/data/minecraft/structure/village/taiga/zombie/town_centers/taiga_meeting_point_2.nbt b/data/minecraft/structure/village/taiga/zombie/town_centers/taiga_meeting_point_2.nbt new file mode 100644 index 0000000..3eddcb6 Binary files /dev/null and b/data/minecraft/structure/village/taiga/zombie/town_centers/taiga_meeting_point_2.nbt differ diff --git a/data/vanilla_skyblock/structure/empty.nbt b/data/vanilla_skyblock/structure/empty.nbt new file mode 100644 index 0000000..e69de29 diff --git a/index.js b/index.js index 5c4c8ca..3c6a450 100644 --- a/index.js +++ b/index.js @@ -19,22 +19,65 @@ function getMetaData(dataPath) { ); } +function getData(namespace, dataPath) { + let encoding = ''; + if (dataPath.endsWith('json')) { + encoding = 'utf8'; + } + + return fs.readFileSync( + path.resolve(__dirname, `data/${namespace}/${dataPath}`), + encoding + ); +} + +function getJsonData(namespace, dataPath) { + return JSON.parse( + getData(namespace, `${dataPath}.json`) + ); +} + function writeData(namespace, dataPath, data) { + return fs.writeFileSync( + path.resolve(__dirname, `data/${namespace}/${dataPath}`), + data + ); +} + +function overwriteData(dataPath, data) { + return writeData('minecraft', dataPath, data); +} + +function writeJson(namespace, dataPath, data) { // sort keys const allKeys = new Set(); JSON.stringify(data, (key, value) => (allKeys.add(key), value)); const sortedKeys = Array.from(allKeys).sort(); // write file - return fs.writeFileSync( - path.resolve(__dirname, `data/${namespace}/${dataPath}.json`), + return writeData( + namespace, + `${dataPath}.json`, JSON.stringify(data, sortedKeys, 2) ); } -function overwriteData(dataPath, data) { - return writeData('minecraft', dataPath, data); +function overwriteJson(dataPath, data) { + return writeJson('minecraft', dataPath, data); +} + + +function replaceData(source, destination) { + const destinationDirectory = path.resolve(__dirname, `data/minecraft/${path.dirname(destination)}`); + if (!fs.existsSync(destinationDirectory)) { + fs.mkdirSync(destinationDirectory, { recursive: true }); + } + + return fs.copyFileSync( + path.resolve(__dirname, `data/vanilla_skyblock/${source}`), + path.resolve(__dirname, `data/minecraft/${destination}`) + ); } @@ -48,7 +91,7 @@ function getWorldgenNoiseSettingsMeta(name) { } function overwriteWorldgenNoiseSettings(name, data) { - return overwriteData(`worldgen/noise_settings/${name}`, data); + return overwriteJson(`worldgen/noise_settings/${name}`, data); } @@ -114,7 +157,7 @@ function getWorldgenStructureMeta(name) { } function overwriteWorldgenStructure(name, data) { - return overwriteData(`worldgen/structure/${name}`, data); + return overwriteJson(`worldgen/structure/${name}`, data); } @@ -250,7 +293,7 @@ for (const noise of noisesToSilence) { firstOctave: 0, amplitudes: [], }); - overwriteData(`worldgen/noise/${noise}`, noiseData); + overwriteJson(`worldgen/noise/${noise}`, noiseData); } @@ -275,7 +318,7 @@ for (const feature of featuresToRemove) { height: 0, }, }); - overwriteData(`worldgen/configured_feature/${feature}`, featureData); + overwriteJson(`worldgen/configured_feature/${feature}`, featureData); } @@ -286,3 +329,78 @@ for (const feature of featuresToRemove) { // TODO if applicable check worldgen/structure.json for pool_start and get location of nbt files. // write to nbt files accordingly + +// ancient city +const ancientCityStartPool = ancientCity.start_pool.replace('minecraft:', ''); +const ancientCityTemplatePool = getMetaData(`worldgen/template_pool/${ancientCityStartPool}`); +for (const templatePoolElement of ancientCityTemplatePool.elements) { + const location = templatePoolElement.element.location.replace('minecraft:', ''); + replaceData('structure/ancient_city.nbt', `structure/${location}.nbt`); +} + +// bastion +const bastionStartPool = getWorldgenStructureMeta('bastion_remnant').start_pool.replace('minecraft:', ''); +const bastionTemplatePool = getMetaData(`worldgen/template_pool/${bastionStartPool}`); +for (const templatePoolElement of bastionTemplatePool.elements) { + const location = templatePoolElement.element.location.replace('minecraft:', ''); + if (location.includes('/units/')) { + replaceData('structure/bastion/bastion_other.nbt', `structure/${location}.nbt`); + } + else if (location.includes('/hoglin_stable/')) { + replaceData('structure/bastion/bastion_hoglin_stable.nbt', `structure/${location}.nbt`); + } + else if (location.includes('/treasure/')) { + replaceData('structure/bastion/bastion_treasure.nbt', `structure/${location}.nbt`); + } + else if (location.includes('/bridge/')) { + replaceData('structure/bastion/bastion_bridge.nbt', `structure/${location}.nbt`); + } +} + +// pillager outpost +const pillagerOutpostStartPool = getWorldgenStructureMeta('pillager_outpost').start_pool.replace('minecraft:', ''); +const pillagerOutpostTemplatePool = getMetaData(`worldgen/template_pool/${pillagerOutpostStartPool}`); +for (const templatePoolElement of pillagerOutpostTemplatePool.elements) { + const location = templatePoolElement.element.location.replace('minecraft:', ''); + replaceData('structure/empty_16.nbt', `structure/${location}.nbt`); +} + +// trail ruins +const trailRuinsStartPool = getWorldgenStructureMeta('trail_ruins').start_pool.replace('minecraft:', ''); +const trailRuinsTemplatePool = getMetaData(`worldgen/template_pool/${trailRuinsStartPool}`); +const trailRuinsRareChancePercent = 25; +const trailRuinsRareMaxIndex = Math.ceil(trailRuinsTemplatePool.elements.length / (100 / trailRuinsRareChancePercent)); +for (const idx in trailRuinsTemplatePool.elements) { + const templatePoolElement = trailRuinsTemplatePool.elements[idx]; + const location = templatePoolElement.element.location.replace('minecraft:', ''); + if (idx >= trailRuinsRareMaxIndex) { + replaceData('structure/archaeology/trail_ruins_common.nbt', `structure/${location}.nbt`); + } else { + replaceData('structure/archaeology/trail_ruins_rare.nbt', `structure/${location}.nbt`); + } +} + +// trial chambers +const trialChambersStartPool = getWorldgenStructureMeta('trial_chambers').start_pool.replace('minecraft:', ''); +const trialChambersTemplatePool = getMetaData(`worldgen/template_pool/${trialChambersStartPool}`); +for (const templatePoolElement of trialChambersTemplatePool.elements) { + const location = templatePoolElement.element.location.replace('minecraft:', ''); + replaceData('structure/trial_chamber.nbt', `structure/${location}.nbt`); +} + +// villages +const villages = [ + 'village_desert', + 'village_plains', + 'village_savanna', + 'village_snowy', + 'village_taiga', +]; +for (const village of villages) { + const villageStartPool = getWorldgenStructureMeta(village).start_pool.replace('minecraft:', ''); + const villageTemplatePool = getMetaData(`worldgen/template_pool/${villageStartPool}`); + for (const templatePoolElement of villageTemplatePool.elements) { + const location = templatePoolElement.element.location.replace('minecraft:', ''); + replaceData('structure/empty_16.nbt', `structure/${location}.nbt`); + } +} -- cgit v1.2.3