Show genuine Melange in spice recipes

This commit is contained in:
Dev 2026-11-27 07:26:12 +01:00
commit 6785b7af36

View file

@ -21,6 +21,8 @@ function item(command) {
export function recipeCatalogue() {
const recipes = [];
const spice = entry('spice', 'Melange Spice', 'orange_dye', true);
const requiresSpice = new Set(['dunesponge.yml', 'spice_paste.yml', 'spice_dough.yml', 'weirding_module.yml']);
for (const file of readdirSync(source).filter(name => name.endsWith('.yml')).sort()) {
const recipe = JSON.parse(readFileSync(new URL(file, source), 'utf8'));
const station = recipe.recipeType === 'FURNACE' ? 'Furnace' : 'Crafting table';
@ -30,7 +32,7 @@ export function recipeCatalogue() {
const inputs = Object.entries(recipe)
.filter(([key]) => /^input\d+$/.test(key))
.sort(([a], [b]) => Number(a.slice(5)) - Number(b.slice(5)))
.map(([, command]) => item(command));
.map(([, command]) => command === 'minecraft:orange_dye' && requiresSpice.has(file) ? spice : item(command));
recipes.push({ id: file.slice(0, -4), station, inputs, output: item(recipe.result), amount: recipe.resultAmount ?? 1 });
}
for (const recipe of JSON.parse(readFileSync(smoker, 'utf8')).smoker) {
@ -38,7 +40,6 @@ export function recipeCatalogue() {
?? entry(recipe.result, recipe.result.replaceAll('_', ' ').replace(/\b\w/g, letter => letter.toUpperCase()), recipe.result === 'spice_bread' ? 'bread' : 'leather', true);
recipes.push({ id: recipe.id + '-smoker', station: 'Smoker', inputs: [item(recipe.inputCommand)], output, amount: recipe.amount });
}
const spice = entry('spice', 'Melange Spice', 'orange_dye', true);
const smuggled = entry('smuggled_spice', 'Smuggled Spice', 'orange_dye', true);
const crafting = 'Crafting table';
for (const part of JSON.parse(readFileSync(repairParts, 'utf8'))) {