From ea72de3eba2087aa1d3b1b0905501eb779b24be9 Mon Sep 17 00:00:00 2001 From: unimatrixgit <95320811+unimatrixgit@users.noreply.github.com> Date: Mon, 30 Nov 2026 18:06:38 +0100 Subject: [PATCH] Add DuneChest recipes and exact upgrade grids to the cookbook --- website/data/cookbook/dunechest-recipes.json | 18 ++++++++++ website/data/cookbook/dunechest-source.json | 33 ++++++++++++++++++ .../cookbook/icons/dunechest_ender_chest.png | Bin 0 -> 791 bytes .../icons/dunechest_speed_hopper_1.png | Bin 0 -> 824 bytes .../icons/dunechest_speed_hopper_2.png | Bin 0 -> 809 bytes .../icons/dunechest_speed_hopper_3.png | Bin 0 -> 835 bytes .../data/cookbook/icons/dunechest_wrench.png | Bin 0 -> 405 bytes website/scripts/recipe-catalogue.mjs | 17 ++++++++- website/tests/dunechest-cookbook.test.mjs | 20 +++++++++++ website/tests/web-repository-scope.test.mjs | 5 +-- website/web/imperial-recipe-book.js | 2 +- 11 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 website/data/cookbook/dunechest-recipes.json create mode 100644 website/data/cookbook/dunechest-source.json create mode 100644 website/data/cookbook/icons/dunechest_ender_chest.png create mode 100644 website/data/cookbook/icons/dunechest_speed_hopper_1.png create mode 100644 website/data/cookbook/icons/dunechest_speed_hopper_2.png create mode 100644 website/data/cookbook/icons/dunechest_speed_hopper_3.png create mode 100644 website/data/cookbook/icons/dunechest_wrench.png create mode 100644 website/tests/dunechest-cookbook.test.mjs diff --git a/website/data/cookbook/dunechest-recipes.json b/website/data/cookbook/dunechest-recipes.json new file mode 100644 index 00000000..ad31d30b --- /dev/null +++ b/website/data/cookbook/dunechest-recipes.json @@ -0,0 +1,18 @@ +{ + "items": { + "ender_chest": {"id":"dunechest_ender_chest","name":"Ender Chest","material":"barrel","custom":true,"icon":"/recipe-icons/dunechest_ender_chest.png","summary":"A custom chest with three colour pads. Matching frequencies share storage on the same planet; diamond toggles the supplied private mode."}, + "speed_hopper_1": {"id":"dunechest_speed_hopper_1","name":"Speed Hopper MK I","material":"hopper","custom":true,"icon":"/recipe-icons/dunechest_speed_hopper_1.png","summary":"A faster hopper with an item filter. Open its settings with a Wrench or sneak-click with an empty hand."}, + "speed_hopper_2": {"id":"dunechest_speed_hopper_2","name":"Speed Hopper MK II","material":"hopper","custom":true,"icon":"/recipe-icons/dunechest_speed_hopper_2.png","summary":"The second Speed Hopper tier. Craft it with a genuine MK I; an ordinary hopper does not satisfy the upgrade recipe."}, + "speed_hopper_3": {"id":"dunechest_speed_hopper_3","name":"Speed Hopper MK III","material":"hopper","custom":true,"icon":"/recipe-icons/dunechest_speed_hopper_3.png","summary":"The third Speed Hopper tier. Craft it with a genuine MK II and netherite ingots."}, + "auto_crafter": {"id":"dunechest_auto_crafter","name":"Auto Crafter","material":"crafting_table","custom":true,"summary":"A custom crafting block that takes ingredients from the container above and sends its result to the container below. Right-click to set its recipe."}, + "wrench": {"id":"dunechest_wrench","name":"Wrench","material":"knowledge_book","custom":true,"icon":"/recipe-icons/dunechest_wrench.png","summary":"Left-click a DuneChest, Speed Hopper or Auto Crafter to open that block’s settings. Works on Java and Bedrock."} + }, + "recipes": [ + {"id":"ender_chest","pattern":["OEO","OBO","OOO"],"ingredients":{"O":"minecraft:obsidian","E":"minecraft:ender_eye","B":"minecraft:barrel"}}, + {"id":"speed_hopper_1","pattern":["GRG","RHR","GRG"],"ingredients":{"G":"minecraft:gold_ingot","R":"minecraft:redstone","H":"minecraft:hopper"}}, + {"id":"speed_hopper_2","pattern":["DRD","RIR","DRD"],"ingredients":{"D":"minecraft:diamond","R":"minecraft:redstone_block","I":"speed_hopper_1"}}, + {"id":"speed_hopper_3","pattern":["NRN","RIR","NRN"],"ingredients":{"N":"minecraft:netherite_ingot","R":"minecraft:redstone_block","I":"speed_hopper_2"}}, + {"id":"auto_crafter","pattern":["IRI","RTR","IDI"],"ingredients":{"I":"minecraft:iron_ingot","R":"minecraft:redstone","T":"minecraft:crafting_table","D":"minecraft:dropper"}}, + {"id":"wrench","pattern":["I I"," I "," S "],"ingredients":{"I":"minecraft:iron_ingot","S":"minecraft:stick"}} + ] +} diff --git a/website/data/cookbook/dunechest-source.json b/website/data/cookbook/dunechest-source.json new file mode 100644 index 00000000..de076cc1 --- /dev/null +++ b/website/data/cookbook/dunechest-source.json @@ -0,0 +1,33 @@ +{ + "sourceRepository": "unimatrix/plugins", + "sourceCommit": "56346a273d1b014fa256d26d34b4a4e33cc1d6b5", + "purpose": "Pinned recipe registration and supplied artwork. The ingredient-consumption follow-up does not change these definitions.", + "files": { + "DuneChest/src/main/java/com/example/dunechest/StorageItems.java": "41c4a853c08877ce369cb4e203332a213ccf377f982181b832c87e1993a69c79", + "DuneChest/src/main/java/com/example/dunechest/StorageRules.java": "d7e273e01e59f297d0670e8ab7410a600e63bd4753be3dadec99f0e965666fd5" + }, + "icons": { + "icons/dunechest_ender_chest.png": { + "source": "network/resource-pack/central/overlay/assets/dunerealms/textures/block/ender_chest_front.png", + "sha256": "88ca2f00bbf7f23fdd47ce5e0f8bc941a59d7c9bb2e5c93d6494ffb60c40b629" + }, + "icons/dunechest_speed_hopper_1.png": { + "source": "network/resource-pack/central/overlay/assets/dunerealms/textures/block/speed_hopper_1.png", + "sha256": "f41ca0dfe2fe591df724c7a25b67338405e1dab6fbf1e978cf7f14b76cd73378" + }, + "icons/dunechest_speed_hopper_2.png": { + "source": "network/resource-pack/central/overlay/assets/dunerealms/textures/block/speed_hopper_2.png", + "sha256": "c6b25e755fb66984cd6d1de254c9b299a9e0279e4637bbae5491bb69be150185" + }, + "icons/dunechest_speed_hopper_3.png": { + "source": "network/resource-pack/central/overlay/assets/dunerealms/textures/block/speed_hopper_3.png", + "sha256": "fae56fa0f0f2724c0184b703b24b2787b17c63837d8d978815beb7f9f265144b" + }, + "icons/dunechest_wrench.png": { + "source": "network/resource-pack/central/overlay/assets/dunerealms/textures/item/wrench.png", + "sha256": "e9d730f7d79114a0dd4699a3b2048ba234ae2589f5eda3f217dad8a02606be7a" + } + }, + "recipeCount": 6, + "iconSource": "Exact supplied wrench sprite and custom block face textures; no rarity or equipment metadata inferred." +} diff --git a/website/data/cookbook/icons/dunechest_ender_chest.png b/website/data/cookbook/icons/dunechest_ender_chest.png new file mode 100644 index 0000000000000000000000000000000000000000..333bd7f185bfc60d4adee898dd690829566d62d2 GIT binary patch literal 791 zcmV+y1L*vTP)C5mN2QixazHo-zfQi!Fbu(GmB75oD%tgNmG))pd`!NS5y(wJIA zAtn|f1eN5#3oPb9`OWM%^JYEKTs+nfj+@(k^S<}K_vYq^jVlX#-W~?gIISR{m6!N;1f4jGC zR~)DAlnlIHdp~mNishBB?(*D%`>?(4PPHf9LD_SsJLg@$?0M&%_N3eI@A`W{_m^(x zr>Fb;oVPnsw4DPQ84oZI?f4jZS)P#`g2ILR}Ih6w&Tpf_J4-&p11lkMO zuVg^%0gU;GSV71Mzi~uB0TW(&L5gu-$tYXE+NvXD0bpchgj|wCE)p_$_$0`wYz_yZ zWKsxw2!|;rpCOG3s+VL081kDyAcqhFu8Tm*aUEL)sjTG}sGorBq5?kBDq>3py7vcc zuRg4&s<62x$R^?LgHSR8Q|VZfh{_WKP|a-(Q}-9{*77^!`p;N>bTO6)#VD1^sP(sU zFO|R^x728%gGYsWfNz4ZO)idX5>iKHjd7}}l{%oabTf;q-+eJOPR#(Irp7NSpg>jv zvb9p7ift-OJhQmq-dw-uuf6^9(Os+PZ6Ml@Uwssal+6?n)HrE!1qH|&VjyyG>Flh# z^6If)Z_(kE8a8{NSz_l&Jce{7bppc%#wbt#wvWW2VU_(M;i4J^`PeAKI+QW6YYPn_ zGM8WVnGj2$vuX{}I-Gl?MPfiHEb-Q}m(fO0<{D^%5(QZgXzJBRsPjW6K=oB1_3IXT zj%fJUC#*^l1F%moI}^gDUytGMj-7=vM+x~GL$3&GruC%jXXP zK(<_-r>^VLbb2R$UteFPww>oTS=a4y-*&qx?P^oM#xcj|Grnn>JWg-5$#>J-&U0=7 zfIu=0lv54VBXef}lKD8C3Z(oIRPBINA7Fa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6>z3&;Qo+^7Z@lK$V%E|Zcw(R=+Tgf)`7 nE&E(RvF|S~-4PUDZdm>UDc7dKhL|yt00000NkvXXu0mjf`-pvT literal 0 HcmV?d00001 diff --git a/website/data/cookbook/icons/dunechest_speed_hopper_3.png b/website/data/cookbook/icons/dunechest_speed_hopper_3.png new file mode 100644 index 0000000000000000000000000000000000000000..366bcd7ca8ab06e95fffd6d4c03476011572fc97 GIT binary patch literal 835 zcmV-J1HAl+P)0OIQ|J!W1$^ zxXsEp$KSo*%!=hsvj;*lcg{Wk&v#B{tJUM1G$9>H_p|kjv{)?e+>G_aUnD+wLPjof+IHWcInM(OKq*2{u1jMc z@k)q<@sU#95xUSu~X}MhW0(p-TSBgA%-3g2ljSM&x z#!ygGASGeQp@i5|;$fH4Fo1|e`ryYQ(d^rYn`yh?`_~`Ex+!Rof+^@|vpt(aZ=sox zP(XBbb$7kYt^+Dg&?BEML@6&l7}2ON=P5w$R);t5m?z(T;r6*_#1?@9N( z2)JHu(xY}A&uvOwbDo~&m*xGoJ?-ziT#sn!0vP-<=tpEQM6^D6RcgbZi45w+0AzLYHvLmfdMF}C>BQe9>6mQI3~t-L@VyQ;XblCA8bUV0ATSJ@>Jj{X#!xz1xggWjmHiS z+7Knq1p4_N=V>BEbP3-3xo=Sp_qS5O#v`g5ke12{$Gk&PT}C716d3b?nxOzyA70S+ z8`1qnR5qgh{#R+6S}1{l%yjQ*-+CY_-2W~4eE^G{LmSax7>zd|1o>oi#rhqeitTg) z*x*?5ud@LTIMU$_n~Vsc^5vp}jrK{0@cN&Swj2MS6!j^%g{gN)e*nhauBU+{j-LPk N002ovPDHLkV1o8pgo6M8 literal 0 HcmV?d00001 diff --git a/website/data/cookbook/icons/dunechest_wrench.png b/website/data/cookbook/icons/dunechest_wrench.png new file mode 100644 index 0000000000000000000000000000000000000000..f66cfedb7e660bc75508f29b00b81426c3cb8c6a GIT binary patch literal 405 zcmV;G0c!qNn+;`Cm&`>x+FQS?N2S@01s0nZZJc^ek z2{i!aV4H_7p%fhHEFcN*EFcZ6#)FWotc+ISj;Ro z9F|O%Id2NPh%Ef{<9yex$Kr5gKn*!~vOAk(vll%%y9w*y@#?AqFWmtj@It^Byi@`A z!lCDyWoLsb{C>XPKIW7B6RK%^R06O!xUc*HDtbb68JQqL00000NkvXXu0mjfdg7}k literal 0 HcmV?d00001 diff --git a/website/scripts/recipe-catalogue.mjs b/website/scripts/recipe-catalogue.mjs index 3a26805d..0101239a 100644 --- a/website/scripts/recipe-catalogue.mjs +++ b/website/scripts/recipe-catalogue.mjs @@ -4,6 +4,7 @@ const source = new URL('../data/cookbook/crafting/', import.meta.url); const smoker = new URL('../data/cookbook/survival-food-recipes.json', import.meta.url); const repairParts = new URL('../data/cookbook/starter-repair-parts.json', import.meta.url); +const duneChest = new URL('../data/cookbook/dunechest-recipes.json', import.meta.url); const arrakisItems = new URL('../data/cookbook/items/', import.meta.url); const vanillaFoodSaturation = { beef: 1.8, enchanted_golden_apple: 9.6 }; const itemSummaries = { @@ -96,6 +97,20 @@ export function recipeCatalogue() { recipes.push({ id: 'brew_water_vial', station: 'Brewing stand', inputs: [blood, spice], output: water, amount: 1, possible: true, notes: brew }); recipes.push({ id: 'brew_water_of_life', station: 'Brewing stand', inputs: [blood, spice], output: life, amount: 1, possible: true, notes: brew + ' Drinking Water of Life has a 1% fatal chance.' }); recipes.push({ id: 'spice_boosted_potion', station: 'Brewing stand', inputs: [entry('imported_potion', 'Imported Potion', 'potion'), spice], output: entry('spice_boosted_potion', 'Spice-Boosted Potion', 'potion', true), amount: 1, notes: 'Brew once on Arrakis. Effect levels are multiplied by 1.25 and rounded to the nearest whole level; duration stays the same.' }); + const storage = JSON.parse(readFileSync(duneChest, 'utf8')); + for (const recipe of storage.recipes) { + if (recipe.pattern.length !== 3 || recipe.pattern.some(row => row.length !== 3)) throw Error('Invalid DuneChest crafting grid'); + const grid = recipe.pattern.flatMap(row => [...row].map(symbol => { + if (symbol === ' ') return null; + const ingredient = recipe.ingredients[symbol]; + const value = ingredient?.startsWith('minecraft:') ? item(ingredient) : storage.items[ingredient]; + if (!value) throw Error('Missing DuneChest ingredient ' + symbol); + return value; + })); + recipes.push({id: 'dunechest_' + recipe.id, station: crafting, inputs: grid.filter(Boolean), grid, + output: storage.items[recipe.id], amount: 1, shaped: true, + notes: 'Available on Arrakis, Caladan, Giedi Prime, Kaitain and Sigmadraken IV. Not installed on Lobby.'}); + } for (const recipe of recipes) { if (foodIds.has(recipe.output.id)) { const definition = JSON.parse(readFileSync(new URL(recipe.output.id + '.yml', arrakisItems), 'utf8')); @@ -104,7 +119,7 @@ export function recipeCatalogue() { if (!Number.isFinite(saturation)) throw Error('Missing saturation for ' + recipe.output.id); recipe.output = { ...recipe.output, material, stats: [{ label: 'Saturation per serving', value: '+' + saturation + ' points' }] }; } - const summary = itemSummaries[recipe.output.id]; + const summary = itemSummaries[recipe.output.id] ?? recipe.output.summary; if (!summary) throw Error('Missing item summary for ' + recipe.output.id); recipe.output = { ...recipe.output, summary }; for (const ingredient of [...recipe.inputs, recipe.output]) { diff --git a/website/tests/dunechest-cookbook.test.mjs b/website/tests/dunechest-cookbook.test.mjs new file mode 100644 index 00000000..8dd79718 --- /dev/null +++ b/website/tests/dunechest-cookbook.test.mjs @@ -0,0 +1,20 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import {readFileSync} from 'node:fs'; +import {createHash} from 'node:crypto'; +import {recipeCatalogue,recipeIcons} from '../scripts/recipe-catalogue.mjs'; + +test('DuneChest cookbook preserves shaped gaps, exact custom upgrade ingredients and all six outputs',()=>{ + const all=recipeCatalogue(),recipes=all.filter(r=>r.id.startsWith('dunechest_')); + assert.equal(recipes.length,6);assert.equal(new Set(recipes.map(r=>r.output.id)).size,6); + const by=id=>recipes.find(r=>r.id==='dunechest_'+id); + const wrench=by('wrench');assert.deepEqual(wrench.grid.map(i=>i?.material??null),['iron_ingot',null,'iron_ingot',null,'iron_ingot',null,null,'stick',null]);assert.equal(wrench.inputs.length,4); + for(const [tier,previous] of [[2,1],[3,2]]){ + const upgrade=by('speed_hopper_'+tier),core=upgrade.grid[4];assert.equal(core.id,'dunechest_speed_hopper_'+previous);assert.equal(core.custom,true);assert.ok(all.some(r=>r.output.id===core.id)); + } + assert.equal(by('ender_chest').inputs.filter(i=>i.material==='obsidian').length,7); + for(const r of recipes){assert.equal(r.grid.length,9);assert.equal(r.amount,1);assert.equal(r.shaped,true);assert.match(r.notes,/Not installed on Lobby/);assert.equal(r.output.quality,undefined);assert.equal(r.output.equipmentMark,undefined);} + const icons=new Map(recipeIcons(recipes));assert.equal(icons.size,5);for(const bytes of icons.values())assert.equal(bytes.subarray(0,8).toString('hex'),'89504e470d0a1a0a'); + const provenance=JSON.parse(readFileSync(new URL('../data/cookbook/dunechest-source.json',import.meta.url)));assert.equal(provenance.sourceCommit,'56346a273d1b014fa256d26d34b4a4e33cc1d6b5');assert.equal(Object.keys(provenance.files).length,2); + for(const [path,source] of Object.entries(provenance.icons))assert.equal(createHash('sha256').update(readFileSync(new URL('../data/cookbook/'+path,import.meta.url))).digest('hex'),source.sha256); +}); diff --git a/website/tests/web-repository-scope.test.mjs b/website/tests/web-repository-scope.test.mjs index d94f5b60..f391fd55 100644 --- a/website/tests/web-repository-scope.test.mjs +++ b/website/tests/web-repository-scope.test.mjs @@ -10,8 +10,9 @@ import {SHARED_FOOTER} from '../scripts/site-chrome.mjs'; test('website-only inputs preserve all 32 published recipes and their exact icon bytes',()=>{ const baseline=JSON.parse(readFileSync(new URL('./fixtures/cookbook-before-repository-split.json',import.meta.url))); const hash=bytes=>createHash('sha256').update(bytes).digest('hex'),recipes=recipeCatalogue(); - assert.equal(recipes.length,baseline.recipes);assert.equal(hash(JSON.stringify(recipes)),baseline.catalogueSha256); - assert.deepEqual(Object.fromEntries(recipeIcons(recipes).map(([name,bytes])=>[name,hash(bytes)])),baseline.icons); + const original=recipes.filter(recipe=>!recipe.id.startsWith('dunechest_')); + assert.equal(original.length,baseline.recipes);assert.equal(hash(JSON.stringify(original)),baseline.catalogueSha256); + assert.deepEqual(Object.fromEntries(recipeIcons(original).map(([name,bytes])=>[name,hash(bytes)])),baseline.icons); }); test('shared menus expose the existing DuneForge workspace and root DuneGit register',()=>{ diff --git a/website/web/imperial-recipe-book.js b/website/web/imperial-recipe-book.js index 79503511..07f801f4 100644 --- a/website/web/imperial-recipe-book.js +++ b/website/web/imperial-recipe-book.js @@ -77,7 +77,7 @@ try { const cooking = selected.station === 'Furnace' || selected.station === 'Smoker'; get('recipe-station-layout').classList.toggle('recipe-station--crafting', crafting); get('recipe-station-layout').classList.toggle('recipe-station--cooking', cooking); - const slots = crafting ? Array.from({ length: 9 }, (_, index) => selected.inputs[index]) : selected.inputs; + const slots = crafting ? selected.grid ?? Array.from({ length: 9 }, (_, index) => selected.inputs[index]) : selected.inputs; get('recipe-grid').replaceChildren(...slots.map(item => { const slot = node('li', ''); if (item) { -- 2.53.0