diff --git a/docs/fluxnetworks-compatibility.md b/docs/fluxnetworks-compatibility.md index d4a6aa1c..b7c14bd8 100644 --- a/docs/fluxnetworks-compatibility.md +++ b/docs/fluxnetworks-compatibility.md @@ -47,7 +47,16 @@ compatibility module does not leak a loot table referencing `flux_station` into servers where Flux Networks is absent. When `enableFluxRecipe` is disabled, the synthetic recipe and world availability are fail-closed. -The isolated `fluxnetworksFixture` runs nineteen GameTests covering registration, +## Craftable presentation + +The Flux `Creating Flux` diagram is selected only for the exact synthetic recipe ID +and a server-synced `WORLD_STATION` presentation whose input, output, station, +layout, and count all match the fixed 1:1 contract. It is clipped and centered +inside the shared Craftable diagram bounds; the common ledger, navigation, craft +controls, and transaction remain unchanged. A changed or overridden recipe falls +back to the normal renderer, and the diagram explains both accepted base blocks. + +The isolated `fluxnetworksFixture` runs twenty GameTests covering registration, synthetic recipe exposure, config gating, block drops, both accepted bases, invalid-base/cache transitions, 1:1 conversion, exact batching, installed-item availability, registry reload/removal behavior, and stale diff --git a/docs/gui-test-world.md b/docs/gui-test-world.md index dd64b023..75402848 100644 --- a/docs/gui-test-world.md +++ b/docs/gui-test-world.md @@ -34,6 +34,7 @@ | `terminal-left-rail` | storage_terminal | Core、Storage Terminal、Crafting Terminal;hotbar 1/2 只負責導航 | 兩種 terminal 的共用 rail、搜尋與置中 | | `bus-configuration` | import_bus | fresh Core、Import/Export Bus、兩個容器及最小互動 kit | 方向、filter、wrench 與 reset 流程 | | `crafting-fuel-page` | crafting_terminal | Creative Storage、完整代表性 items/typed resources、Transform reserves、Processing/Instant Stations、descriptor-keyed work;hotbar 3 的 Coal 是唯一視覺輸入 | 四頁共用 header/content bottom、自適應grid列數、立即row scroll、空白 top search、Transform logical source、Stations All/Installed與固定稀疏列、未安裝station明顯降低可見度、logical family tooltip、固定 type capacity、無外框recipe preview/header頁碼 | +| `flux-station` | flux_station | Flux Station、bedrock base、64 redstone、Storage/Crafting terminals、空玩家背包 | dedicated station texture、world-station availability、animated Creating Flux shared Craftable card、bedrock/flux_block base explanation、1 redstone→1 flux dust、無 world block/entity mutation | | `terminal-scale` | crafting_terminal | on-demand 10,000或30,000個exact component variants、目前runtime registry每種非空item各`--items-per-type`個(預設64)、全部Processing/Instant descriptors、typed/work reserves、Storage/Crafting兩種Terminal、Creative Storage、單一production repository record、空玩家背包 | 兩種Terminal prepared open、Craftable與recipe preview、grab-offset thumb drag、track page/repeat、立即row wheel、framed widget states、長列表搜尋/排序/遠頁、4px recipe inset、craftable-first排序與`n / craftable (total)`;真正cold效能由matrix gate負責 | | `patchouli-guide` | overview | Guide Book | 章節、文字、連結與版面 | @@ -62,6 +63,9 @@ 不得要求玩家先裝機器或搬運資源。 - Core另預載Modern Industrialization Aluminum Blade與Macerator;展開並hover其EMI recipe diagram不得因recipe widget使用負座標或外擴drawable而crash。 +- `flux-station` 的自訂 Creating Flux diagram 必須只出現在 exact synthetic recipe 上, + 留在 shared Craftable diagram bounds 內,保留 ledger/navigation/craft controls,並說明 + bedrock 與 `fluxnetworks:flux_block` 兩種有效 base;其他 recipe 不得因相同形狀誤選動畫。 - Instant Stations 預載 Ultimate Crafting Table;Core預載Extended Crafting預設19種 exact component Singularity各1個。Scenario不再注入假Diamond recipe;玩家直接選 真實Ultimate Singularity,preview必須重用EMI完整9×9 public widget而不是native diff --git a/docs/macos-fullscreen-guide.md b/docs/macos-fullscreen-guide.md index 5256af16..a65be49d 100644 --- a/docs/macos-fullscreen-guide.md +++ b/docs/macos-fullscreen-guide.md @@ -42,6 +42,11 @@ READY 後先確認完整遊戲內容、左下版本文字、底部 hotbar 與 GU `crafting-fuel-page`是一個batched visual gate。世界在handoff前已把代表items、optional stations(含Powah Furnator與Ultimate Crafting Table)、Processing work、Fuel/Brew/Axe、fluid/FE/chemical/Source/Mana與recipe材料寫入唯一server-owned Core record;代表Crusher的Processing aggregate預載為`Integer.MAX_VALUE`,但prototype count仍為1。Honey Bottle、Energized Steel、Manasteel Ingot、Hydrogen Chloride與真實Ultimate Singularity的19種exact component材料都可直接預覽,不需setup。玩家只保留hotbar `1`/`2`導航物與hotbar `3`的一顆Coal作Transform Fuel/FE多用途視覺輸入。不得要求使用者逐台安裝、逐項補資源、等待work或先完成craft;這些行為由GameTest/fixture負責。使用者只需通過fullscreen gate、開Storage/Craftable/Transform/Stations、把預載Coal shift-click進Transform並目視。四頁寬版content bottom應一致對齊player inventory上緣;四頁搜尋欄共用top header、focused input router與query parser,只有scope不同。裸`@/#/$`必須等同空查詢並顯示全部,欄內可繼續輸入,點擊欄外則解除focus但保留query;`@creat`必須命中Create,空值不畫placeholder。Transform檢查persistent target list/search/page、Auto exact-input Show Uses、上方可見input與amount strip、明確card selection及card內聯source/station-work;card緊接input/action row、固定32px高並靠上排列,card分頁鈕在card區下方,單頁隱藏時不留下空白頂列;Powah tier variants的source統一顯示logical `Furnator`,不再有底部selected preview。Stations固定只有Processing/Instant兩區,但可見列數依可用高度自適應;F11代表尺寸下Processing較寬且三欄,安裝數疊在item、旁邊為累積work,最後一列不足三項仍保持相同欄寬並靠左靠上;Instant則為不顯示installed count或work的compact icon grid。兩區各自有前後頁與滾輪;`Show: All`必須顯示全部已註冊descriptor並以灰階標示未安裝項,`Show: Installed`只保留已安裝項,非空搜尋也遵守同一scope後才合併stations;inventory旁status panel永遠只顯示type capacity,不隨hover變成重複資訊。Storage/Craftable必須依可用高度填滿所有完整列(目前F11代表尺寸超過9列);scrollbar有完整recessed frame與enabled/pressed/disabled狀態,thumb按下不跳並保留grab offset,track按下翻頁且持續按住會重複,wheel每次立即移動一列;不得有排隊、easing、彈性或回彈。resource selector另有聚合item/typed keys的All,tooltip精確為`Show: All`;Gases保留Oxygen/Hydrogen/Chlorine名稱並使用EMI colored chemical glyph與exact recipe amount,不能顯示Chemical Tank/Brewing Stand或64,000 tank capacity。Energy資源頁顯示FE與可轉換reserve,**Processing**獨立顯示descriptor-keyed加工量;數值hover必須顯示各自的logical family名稱與aggregate rate,不得全部顯示`Station Work`。fresh `Use Player Inventory`應為Off;Transform/Stations重用Storage Sort Method/Order;non-item output鎖Storage。Craftable warm return應立即使用目前自適應viewport cache且不得產生新keep-up warning;MI Aluminum Blade Macerator EMI diagram必須可render/hover且不能crash。Recipe workspace不得再畫包住整個右側的冗餘外框;diagram/ledger上方與左右皆使用4px inset,EMI public widget原尺寸放得下就不縮,否則完整等比縮放。相同exact output的可合成variant必須在前,rerank保留exact selection;右上顯示`n / craftable (total)`。Ultimate Singularity必須顯示EMI/TMRV完整9×9 widget而不是native 3×3摘要;ledger的`1/1`等短數值保持單行,只有實際溢出才拆兩行。Recipe ledger、station badge 1000ms輪播、registered resource groups與optional-mod recipes仍由使用者目視判定。完整world/profile/checklist契約見[`docs/gui-test-world.md`](gui-test-world.md)。EvilCraft GUI不在combined gate,只用隔離GameTest證據。 +`flux-station` scenario 另外驗證 dedicated Flux Station texture、world-station availability、 +exact animated Creating Flux card bounds、bedrock/`fluxnetworks:flux_block` base explanation、 +1 redstone → 1 flux dust,以及 storage transaction 不修改 world block/entity;這些也必須由 +使用者完成 current F11 visual verdict。 + `terminal-scale`只在大量列表/scrollbar/recipe-ordering變更時on demand產生。`--scale-types`只接受10,000或30,000;世界使用一筆production repository record與每段≤63種的exact component variants,玩家背包為空且已面向Crafting Terminal。使用者只需F11批准後目視thumb drag不跳、track page/repeat、wheel立即一列、遠頁與搜尋/排序,以及4px recipe inset、craftable-first順序與`n / craftable (total)`;不需要準備或搬運任何物品。 ## Active GUI utility: MacFix 0.1.0 diff --git a/docs/notes.md b/docs/notes.md index 3521812b..c9e270f9 100644 --- a/docs/notes.md +++ b/docs/notes.md @@ -1,3 +1,5 @@ +2026-08-22 Craftable animated Flux presentation:Flux 的 `Creating Flux` 只在明確的 `auto_storage:flux_station/redstone_to_flux_dust` presentation ID、`WORLD_STATION` kind、1×1 redstone→flux_dust、Flux Station 與單一輸出語意全部吻合時啟用;任何 recipe override 或語意漂移都回到普通 renderer。Native、EMI、JEI 與 Flux 共用 diagram bounds 的垂直置中;EMI、JEI 與 Flux 自己以 scissor 裁切,Native 依 geometry 內的 slot bounds 繪製。Flux 自己繪製站點動畫,不重複 shared station badge。`flux-station` GUI scenario 另驗動畫留在同一 Craftable card、共用 ledger/navigation/craft controls,並說明 bedrock/flux_block 兩種 base。 + 2026-08-22 CurseMaven CI transport correction:GitHub Actions repeatedly received HTTP 429 from the Cloudflare-fronted `www.cursemaven.com` endpoint while resolving generated POMs, although the pinned Flux Networks jar remained valid. All CurseMaven repository declarations now use the documented Cleanroom endpoint `https://curse.cleanroommc.com`; its exact Flux artifact resolves in a clean Gradle cache with the existing SHA-256 pin. The beta `cfa2.cursemaven.com` route is not used as a production fallback. 2026-08-20 Flux Station integration correction:client descriptor-state packets now trigger a screen rebuild so world-only Stations visibility cannot remain stale after a revision update. Persisted valid-position bits are not trusted on load; only currently loaded blocks are revalidated, stale/invalid/unknown entries fail closed, chunk unload removes cached availability until chunk load refreshes it, and loaded non-overworld dimensions are revalidated at startup. Config re-enable refreshes loaded station positions. The Flux fixture covers stale persistence, unload/reload, config re-enable, disabled terminal crafting, and missing/air Flux base rejection. A dedicated Flux Station texture is generated and its models no longer reuse the Core texture; survival acquisition now uses a conditional Auto Storage/Flux Networks bridge recipe. The optional Flux base lookup also rejects the registry's `Blocks.AIR` sentinel rather than testing for null. diff --git a/docs/overview.md b/docs/overview.md index 4abff9d0..f8a99204 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -19,7 +19,7 @@ - **工具與終端進程** — Wrench 是 Brush + Tripwire Hook 的廉價建設工具。Storage Terminal 保持起步期但加入紅石火把控制件;Crafting Terminal 以金、銅、紅石和工作台成為早中期升級;Remote Terminal 再要求終界珍珠、黑曜石與指南針,作為較晚取得的移動能力。指南書本身註冊為 `auto_storage:guide_book` 並可合成。 - **Transforms and Stations** — Fuel、Brew、Axe、FE、Mana與addon資源都保存於Core的同一typed ledger。Transform頁把一個明確input以×1/×8/×64/Max轉成typed資源;輸入與amount strip都留在上方,Auto只列可用用途,不會自行消耗,每張card直接標示來源或所需station/work,失敗時input、資源與輸出保持原狀。Stations頁只分Processing與Instant:Processing按exact installed variant的live rational rate累積work,可安裝到`Integer.MAX_VALUE`並顯示installed aggregate/rate/work;Instant每descriptor最多一台,只解鎖配方且不顯示installed數量或work。兩區都有獨立前後頁與滾輪;`All`與搜尋結果中的未安裝代表物明顯變暗,已安裝物保持原始亮度;非空搜尋才合併stations,Processing最後一列不足欄數也保持固定欄寬並靠左靠上,inventory旁status panel只顯示type capacity且不隨hover重複資訊。物品hitbox保留exact機器的原生tooltip;Processing數值hitbox使用server同步的logical family名稱與aggregate rate,不再把Crusher、Energizing Rod、Furnator等不同資源全部叫做`Station Work`。Furnace cooking time、燃料burn time、工具耐久與optional-mod provider的recipe/config是數值真值;Botania Elven Trade也會消耗runtime exact Mana。所有mutation只在server,client只接同步。 - **World stations** — When Flux Networks is loaded, the `auto_storage:flux_station` block replaces the original Flux interaction position and exposes only the fixed 1 redstone → 1 `fluxnetworks:flux_dust` transaction. Its two-below bedrock/`flux_block` base is checked server-side; placed positions persist per dimension, unloaded or stale positions fail closed until revalidated, and the block or its installed item can satisfy the same descriptor. The original Flux world event and ground-item/world mutation remain unsupported. -- **Crafting Terminal GUI** — `TerminalProfile`與唯一`TerminalLayout.forProfile(...)`讓Storage Terminal成為Crafting Terminal的減配版;Crafting固定提供Storage、Craftable、Transform、Stations四頁。寬版四頁content bottom一致對齊player inventory上緣,四頁搜尋欄共用top header位置、同一focused-key/character router與`TerminalSearchQuery` parser,只有候選scope不同;空查詢不顯示placeholder,裸`@`、`#`、`$`都等同空查詢並顯示全部,玩家仍可在欄內繼續輸入;點擊欄外會解除focus但保留query與結果;`@mod`對namespace做substring match,所以`@creat`可命中Create / Create Crafts & Additions;Processing以代表工作站的item namespace比對,`#tag`在All中仍以真正Item holder比對。Storage/Craftable的server-owned資源選擇器只循環已註冊的Item/Fluid/Energy/Gas/**Processing**/Other群組,最後另有聚合全部key的**All**(tooltip固定為`Show: All`);Energy包含FE、Fuel/Brew、Mana與Source,Processing只含descriptor-keyed加工量,Axe Uses與未分類addon值留在Other。`station_work`仍是server persistence/API技術名稱,不再直接當玩家名稱;Mekanism chemical entry保留Oxygen/Hydrogen等exact名稱,並直接渲染EMI的colored chemical glyph;internal carrier不得直接顯示給玩家;All中的Item仍走普通顯示/取出/選取路徑,只有non-item代表物不可被當成icon物品取出。physical-client的`auto_storage-client.toml`全域保存sort/order/search sync/resource view、Auto Focus,以及Crafting page/source/output/Transform target;search文字、scroll、selection與任何Core狀態不保存。Craftable使用server-start預熱的shared weak recipe index與exact family dispatch;每次snapshot建立ItemKey/item source index,避免每個recipe掃完整大型庫存。Simple ingredient直接使用item-total;NeoForge `DataComponentIngredient`只以完整item-type集合篩候選,exact component predicate仍逐variant驗證並在一次listing內共用matching結果;完整item coverage的EnderIO `ConduitIngredient`可按item type索引,其他有item representatives的non-exhaustive custom predicate保持完整掃描,空代表物與fluid-aware ingredient則fail closed。開啟Terminal或停在Storage頁不建立Craftable結果;Core只建立目前請求的sort index,search/source metadata由大型GUI fixture在handoff前顯式prepare。完成listing後,每個Core只保留一份由recipe/craftability/machine/topology revision、query、sort與resource view守護的server-side shared result;Use Player Inventory繞過cache。Processing正向work不會每tick清空結果,只有跨過記錄的energy/station threshold才重建,任何減少、一般ingredient/typed resource改變、機器、拓撲或recipe reload仍明確失效。recipe preview由server-synced presentation驅動,已安裝的EMI或JEI負責公開配方圖(兩者都在時優先EMI),Auto Storage保留Available/Required ledger、輸出容量與原子commit。Public widget原尺寸放得下就直接畫,否則完整等比縮放;TMRV等bridge沒有backing holder時,只接受exact output與完整item-input multiset唯一吻合的public recipe,歧義時fail closed。短數值如`1/1`維持單行,只有實際超過cell寬度才拆兩行;recipe workspace不再畫冗餘外框,diagram/ledger共用4px上/側inset。相同exact output的recipe先依`maxCraftable > 0`分組,再依adapter priority與完整recipe ID排序;rerank保留exact selected ID,包含0-craftable狀態,右上header顯示`n / craftable (total)`。Scrollbar使用有recessed frame及enabled/pressed/disabled狀態的vanilla scroller;按thumb保留精確grab offset,按track翻頁並在持續按住後重複,wheel立即移動一個server對齊完整列;Craftable重建或cache restore縮短結果時也重用同一row-aligned clamp;沒有easing、queue、彈力或client storage snapshot。Storage/Craftable依可用高度使用全部完整列,Stations另有All/Installed顯示切換並依可用高度自適應,Processing使用較大的最多三欄區域、item-overlay安裝數與水平累積work,Instant使用緊密icon grid;Transform使用持續顯示、可搜尋/換頁的target側欄與必須明確選取的水平use cards,不另畫重複的selected preview;Transform與Stations直接重用Storage的Sort Method/Order及同一comparator;provider card與machine descriptor都先採EMI category語意,再使用對全部accepted workstation variants都成立的最短family名稱,tier/speed只留在輪播圖示而不進label。 +- **Crafting Terminal GUI** — `TerminalProfile`與唯一`TerminalLayout.forProfile(...)`讓Storage Terminal成為Crafting Terminal的減配版;Crafting固定提供Storage、Craftable、Transform、Stations四頁。寬版四頁content bottom一致對齊player inventory上緣,四頁搜尋欄共用top header位置、同一focused-key/character router與`TerminalSearchQuery` parser,只有候選scope不同;空查詢不顯示placeholder,裸`@`、`#`、`$`都等同空查詢並顯示全部,玩家仍可在欄內繼續輸入;點擊欄外會解除focus但保留query與結果;`@mod`對namespace做substring match,所以`@creat`可命中Create / Create Crafts & Additions;Processing以代表工作站的item namespace比對,`#tag`在All中仍以真正Item holder比對。Storage/Craftable的server-owned資源選擇器只循環已註冊的Item/Fluid/Energy/Gas/**Processing**/Other群組,最後另有聚合全部key的**All**(tooltip固定為`Show: All`);Energy包含FE、Fuel/Brew、Mana與Source,Processing只含descriptor-keyed加工量,Axe Uses與未分類addon值留在Other。`station_work`仍是server persistence/API技術名稱,不再直接當玩家名稱;Mekanism chemical entry保留Oxygen/Hydrogen等exact名稱,並直接渲染EMI的colored chemical glyph;internal carrier不得直接顯示給玩家;All中的Item仍走普通顯示/取出/選取路徑,只有non-item代表物不可被當成icon物品取出。physical-client的`auto_storage-client.toml`全域保存sort/order/search sync/resource view、Auto Focus,以及Crafting page/source/output/Transform target;search文字、scroll、selection與任何Core狀態不保存。Craftable使用server-start預熱的shared weak recipe index與exact family dispatch;每次snapshot建立ItemKey/item source index,避免每個recipe掃完整大型庫存。Simple ingredient直接使用item-total;NeoForge `DataComponentIngredient`只以完整item-type集合篩候選,exact component predicate仍逐variant驗證並在一次listing內共用matching結果;完整item coverage的EnderIO `ConduitIngredient`可按item type索引,其他有item representatives的non-exhaustive custom predicate保持完整掃描,空代表物與fluid-aware ingredient則fail closed。開啟Terminal或停在Storage頁不建立Craftable結果;Core只建立目前請求的sort index,search/source metadata由大型GUI fixture在handoff前顯式prepare。完成listing後,每個Core只保留一份由recipe/craftability/machine/topology revision、query、sort與resource view守護的server-side shared result;Use Player Inventory繞過cache。Processing正向work不會每tick清空結果,只有跨過記錄的energy/station threshold才重建,任何減少、一般ingredient/typed resource改變、機器、拓撲或recipe reload仍明確失效。recipe preview由server-synced presentation驅動,已安裝的EMI或JEI負責公開配方圖(兩者都在時優先EMI),Auto Storage保留Available/Required ledger、輸出容量與原子commit。Flux 的 `Creating Flux` 是明確 ID 與完整語意驗證後才啟用的自訂 Craftable renderer;它與 native/EMI/JEI 共用 diagram bounds、ledger、導航與 craft controls;EMI、JEI、Flux 以 scissor 裁切,Native 依 geometry 內 bounds 繪製。不符的 override 一律回到普通 renderer。Public widget原尺寸放得下就直接畫,否則完整等比縮放;TMRV等bridge沒有backing holder時,只接受exact output與完整item-input multiset唯一吻合的public recipe,歧義時fail closed。短數值如`1/1`維持單行,只有實際超過cell寬度才拆兩行;recipe workspace不再畫冗餘外框,diagram/ledger共用4px上/側inset。相同exact output的recipe先依`maxCraftable > 0`分組,再依adapter priority與完整recipe ID排序;rerank保留exact selected ID,包含0-craftable狀態,右上header顯示`n / craftable (total)`。Scrollbar使用有recessed frame及enabled/pressed/disabled狀態的vanilla scroller;按thumb保留精確grab offset,按track翻頁並在持續按住後重複,wheel立即移動一個server對齊完整列;Craftable重建或cache restore縮短結果時也重用同一row-aligned clamp;沒有easing、queue、彈力或client storage snapshot。Storage/Craftable依可用高度使用全部完整列,Stations另有All/Installed顯示切換並依可用高度自適應,Processing使用較大的最多三欄區域、item-overlay安裝數與水平累積work,Instant使用緊密icon grid;Transform使用持續顯示、可搜尋/換頁的target側欄與必須明確選取的水平use cards,不另畫重複的selected preview;Transform與Stations直接重用Storage的Sort Method/Order及同一comparator;provider card與machine descriptor都先採EMI category語意,再使用對全部accepted workstation variants都成立的最短family名稱,tier/speed只留在輪播圖示而不進label。 - **Terminal(三階)** — `storage_terminal`(T1 取存)、`crafting_terminal`(T2 配方+一鍵合成)、`remote_terminal`(T3 物品,同維度遠端存取;綁 exact Core UUID,同座標 replacement 不會被靜默接管;重綁不覆蓋其他 `CUSTOM_DATA`)。 - **Network / Bus automation** — Core 掃描/維護 Core ↔ Unit ↔ Terminal/Bus 連通;一般/指令/活塞放置會合併到 next-tick topology pass,安全範圍內增量成長,破壞/不確定拓樸時 full rebuild。Server 也會依 FULL chunk lifecycle延後、合併並bounded掃描loaded network boundary;Terminal/Bus只沿目前已載入且仍為network block的cached path工作,絕不為驗證連線載入chunk。Directional Import/Export每10 tick在正面各自嘗試一個item stack與一個bounded typed resource,並同時掃generic addon endpoint與native fluid/FE/optional chemical endpoint;成功item不會餓死typed,同一外部方塊的generic與native資源可同時被發現。Import在設定允許的side/null另暴露stable insert-only item/generic/native capabilities;Export只有Directionless才暴露filtered extract-only能力,item只是一格、最多正常stack的安全view,generic typed路徑明確拒絕Item kind。Mode、六面mask、unsided、automation、Allow/Deny與九格filter由server menu原子設定;owner/operator、距離、當前BE、stale revision與Wrench操作全部server驗證,legacy首次有效操作才claim owner。每個cached wrapper每次call都重驗BE identity、escrow、mode/side、filter、loaded Core path與conflict;缺Core時保持inert,設定面改變則invalidate capability。structured actor guard阻止same-network/inverse re-entry。Item與typed immutable plan都在commit前及external execute callback後重驗Bus/config/Core/network/topology/path/endpoint;Import不寫回detached source,Export會反向reclaim已接受量,detached target拒絕歸還的exact item或typed差額也走recovery。rollback無法立即歸還時進Bus持久escrow,若Bus已被移除/取代則改產生owner-stripped recovery drop,絕不寫detached BE。能力暫停並先回流Core;一般/創造/Wrench/爆炸/direct-air/替換拆除都必須先回收或保存exact escrow;Wrench尊重其他mod取消或替換普通BlockDropsEvent結果,只有仍無法回流Core的exact escrow才用per-Bus recovery UUID建立direct drop,避免資料被later listener吞掉或把兩次移除誤dedupe。 - **Supported recipes / safe output** — Vanilla exact-concrete Shaped/Shapeless Crafting、Stonecutting、Smelting、Blasting、Smoking、Campfire、component-exact `SmithingTransformRecipe`、component-preserving `SmithingTrimRecipe`,以及只掃 `minecraft` namespace default state 的 internal synthetic axe strip/scrape/wax-off;任何 namespace 使用相同 exact vanilla class/type 都零設定支援。Optional source-audited modules另支援Farmer's Delight Cooking Pot;Mekanism支援九個Factory-backed families、Pressurized Reaction、兩種安全單向Rotary shape及Chemical Oxidizer、Chemical Infuser、Electrolytic Separator、Chemical Dissolution Chamber、Chemical Washer、Chemical Crystallizer、Isotopic Centrifuge、Antiprotonic Nucleosynthesizer、Pigment Extractor、Pigment Mixer、Painting Machine,完整22/26 recipe-type盤點與排除理由見[`mekanism-compatibility.md`](mekanism-compatibility.md);Botania支援Mana Infusion、Runic Altar、Terrestrial Agglomeration、Petal Apothecary與Elven Trade;Modern Industrialization支援14個direct `MachineRecipe` families及exact item/fluid/EU/catalyst/multi-output transaction,tier/proxy/RNG邊界見[`modern-industrialization-compatibility.md`](modern-industrialization-compatibility.md);Ars Nouveau支援Imbuement與Enchanting Apparatus的exact Source/item/catalyst/remainder/component transaction,邊界見[`ars-nouveau-compatibility.md`](ars-nouveau-compatibility.md);EvilCraft支援Blood Infuser的exact item/Blood/Promise tier/duration/output transaction,XP/Purifier邊界見[`evilcraft-compatibility.md`](evilcraft-compatibility.md);Powah支援1–6 item Energizing、scaled FE與loaded rod throughput,邊界見[`powah-compatibility.md`](powah-compatibility.md);Industrial Foregoing支援Dissolution Chamber、Material Stonework Factory與Crusher的exact item/fluid/FE/work transaction,Pitiful Generator與Furnace Mycelial Generator station則支援smelting fuel→FE(burnTime×30/80,邊界見[`industrial-foregoing-compatibility.md`](industrial-foregoing-compatibility.md));Create支援deterministic Milling、Crushing、Cutting、Filling與Emptying,邊界見[`create-compatibility.md`](create-compatibility.md);Create Crafts & Additions支援deterministic Rolling與Charging,Liquid Burning fail-closed,邊界見[`createaddition-compatibility.md`](createaddition-compatibility.md);Extended Crafting支援安裝Ultimate Crafting Table後的3×3–9×9 exact shaped-table recipes及真實Ultimate Singularity,含最多81個exact input groups、component identity、remainders與rollback,邊界見[`extended-crafting-compatibility.md`](extended-crafting-compatibility.md);Oritech支援exact pulverizer item/FE/work與deterministic multi-output remainder,邊界見[`oritech-compatibility.md`](oritech-compatibility.md);Theurgy支援deterministic Calcination、Distillation與Liquefaction,邊界見[`theurgy-compatibility.md`](theurgy-compatibility.md);Integrated Dynamics支援Drying Basin、Mechanical Drying Basin與僅`chance==1.0F`的Mechanical Squeezer exact item/fluid/FE/work transaction,邊界見[`integrated-dynamics-compatibility.md`](integrated-dynamics-compatibility.md);Integrated Crafting目前只跑present-mod fail-closed fixture(network automation/DeadBush),邊界見[`integrated-crafting-compatibility.md`](integrated-crafting-compatibility.md)。Advanced AE 1.6.11的Reaction Chamber因live AE-network power、speed-card state與generic item/fluid stacks維持fail closed;present-mod module不註冊station或recipe family,邊界見[Advanced AE compatibility](advanced-ae-compatibility.md)。Transform頁的item-fueled generator stations:EnderIO Stirling(burnTime×0.375×0.8×40,拒絕remainder燃料)、Actually Additions Coal/Oil(burnTime×20)、Integrated Dynamics Coal(burnTime×20)、Draconic Evolution Generator(base 40 FE/tick)、Industrial Foregoing Pitiful(×30)與Furnace Mycelial(×80)、Oritech Fuel(×256)、Powah Magmator(lava桶→10×magmatic值、retained空桶)與Furnator、Productive Bees Honey(125/500 work、retained容器)、RFTools Power Coal(coal/charcoal/block,600/5,400 work)、Just Dire Things Simple Coal Generator(burnTime×15、burnTime/4 work)、Generator Galore十二台(copper/gold/iron/diamond/emerald/netherite/obsidian/netherstar/halitosis/culinary/enchantment/ender,rate×burnTime×consumptionRate,enchantment retained書)與Mekanism Gas-Burning(罐內gas→mb×energyDensity、ceil(mb/256) work、retained空罐)全部time-based station-work conversions,加上Mekanism Energy Conversion(紅石粉→10,000 FE、紅石塊→90,000 FE)與Mekanism Chemical Conversion(紅石/金/鑽石/精煉黑曜石粉→10 mb infusion、osmium錠→200 mb chemical、coal→carbon等,server-start重建的live datapack表)與Powah Furnator等instant conversions。所有轉換值都活在 `ConversionPattern`/`ConversionScanner` 架構下(公開API):Mekanism conversion shapes 自動發現(任何 mod 用 `ItemStackToChemicalRecipe`/`ItemStackToEnergyRecipe` API 註冊的 recipes 自動成為 Transform uses,datapack 變更於 reload 反映,revision digest 驅動 cache 失效);gas fuel datamap 與 GeneratorGalore generator registry 也是自動發現(單一 pattern 遍歷 live registry/datamap,新增 generator JSON 自動涵蓋);config 型 generators 為 module patterns(config 檔即玩家的 pattern 介面,live 讀取);DE/AA/EnderIO/Botania 的 code 常數保留為 machine truth;個別機制見各mod compatibility doc。所有exact sized item/fluid/chemical/Mana、FE、station work、retained catalyst、container remainder與deterministic multi-output都放進同一atomic transaction;non-item primary只送Storage。Custom exact class/type可透過公開`auto_storage:recipe_family` registry一次註冊整個family;`singleItemToItem`處理窄單輸入,`deterministicResources`處理1–81個item/fluid/power/chemical/addon alternatives、retained roles與alternative-specific remainders。開啟Use Player Inventory時,typed item input與普通配方一樣把Core及可見36格玩家背包放進同一exact simulate/commit plan;non-item typed input仍只讀Core。沒有名稱、serializer、`Recipe#getIngredients()`或EMI widget推測fallback。每種都先要求Core安裝matching station或具備足夠Axe Energy。所有lookup/select/current/reload/execute都按ID重取目前server holder;輸入、work/Fuel、typed outputs、玩家/Core destination與capacity完整simulate後才commit,失敗整批rollback。Direct `×1/×8/×64/Max` 與 EMI request維持各自既有destination contract。第三方recipe-viewer metadata由原mod擁有:Iron Furnaces以自己的JEI plugin註冊Smelting catalysts,Prism GUI support pack由TMRV把該JEI plugin metadata接到EMI且不安裝JEI;Auto Storage只管理terminal station variants,絕不替第三方呼叫EMI `addWorkstation`。PneumaticCraft目前只跑present-mod fail-closed fixture:其Air無simulate/accepted amount且可為負值,pressure/heat/multiblock是live retained state,所以不註冊Air kind或recipe family;完整審計見[`pneumaticcraft-compatibility.md`](pneumaticcraft-compatibility.md)。Immersive Engineering目前支援Arc Furnace與Bottling Machine的deterministic subsets;Sawmill、Crusher、Alloy Smelter與Metal Press因sawblade/fuel/mold/tag-output state未納入exact transaction而維持fail closed,其餘format-17 candidates也因multiblock、live fuel/tank、`RecipeMultiplier`、chance/`TagOutput`維持fail closed;完整審計見[`immersiveengineering-compatibility.md`](immersiveengineering-compatibility.md)。Create Aquatic Ambitions 2.0.4也只跑present-mod fail-closed fixture:Channeling依賴Encased Fan world catalysts、Conduit side effect與chance outputs,所以不註冊station、resource kind或recipe family;完整審計見[`create-aquatic-ambitions-compatibility.md`](create-aquatic-ambitions-compatibility.md)。Create Enchantment Industry `2.5.0-preview-alpha1`同樣只跑present-mod fail-closed fixture:Grindstone kinetics/tank/disenchant、Printer template behaviour與Blaze Enchanter/Forger randomness都無法進atomic transaction,所以不註冊station、resource kind或recipe family;完整審計見[`create-enchantment-industry-compatibility.md`](create-enchantment-industry-compatibility.md)。Draconic Evolution 3.1.4.632的Fusion Crafting仍fail closed(live multiblock injectors、tiered energy charging與config-timed state machine),但Generator station支援smelting fuel→FE(base 40 FE/tick,見[`draconicevolution-compatibility.md`](draconicevolution-compatibility.md))。Productive Metalworks支援Foundry item melting與consume-cast item/block casting;fluid alloying、entity melting與reusable molds仍因live fuel/temperature、cooling/config或entity mutation fail closed,完整審計見[`productivemetalworks-compatibility.md`](productivemetalworks-compatibility.md)。Productive Bees 1.21.1-13.13.5的16個actual recipe classes經format-17重審後因chance、live bee/entity/world、dynamic component或machine-state語意維持零recipe-family Outcome C,但Honey Generator station支援honey瓶/塊/桶→FE(125/500 work,retained容器,見[`productivebees-compatibility.md`](productivebees-compatibility.md))。Railcraft Reborn 1.2.10同樣只跑present-mod fail-closed fixture:受審concrete recipes因chance、live multiblock/machine state或special-crafting語意全部rejected,不註冊station、resource kind或recipe family;完整審計見[`railcraft-compatibility.md`](railcraft-compatibility.md)。目前仍不執行遞迴合成;multi-step路線見 [`recipe-family-api.md`](recipe-family-api.md) 及 `docs/superpowers/plans/2026-07-14-modded-recipes-multistep-crafting.md`,EMI tree只作client規劃/參考介面。Chance/dynamic/per-tick-use families、缺少registry context、Brewing、任意mod block hook、自由world/player-context recipe與external-machine send-and-wait仍fail closed。 diff --git a/docs/plan.md b/docs/plan.md index 4fdceb0d..21d11808 100644 --- a/docs/plan.md +++ b/docs/plan.md @@ -1,3 +1,4 @@ +- 2026-08-22 Craftable animated Flux presentation:`FluxRecipeDiagramRenderer` 僅接受明確 recipe ID、`WORLD_STATION` kind 與完整 1×1 redstone→flux_dust/Flux Station semantics;不符時回到標準 renderer。Native、EMI、JEI 與自訂動畫共用 diagram bounds 的垂直置中與 tooltip/hitbox邊界;EMI、JEI、Flux 另以 scissor 裁切,Native 依 geometry 內 slot bounds 繪製。Flux 不再重複 shared station badge。`flux-station` GUI checklist 增加 shared Craftable card、bedrock/flux_block base 與 1:1 transaction 視覺驗收。 - 2026-08-21 AE2-style terminal repository synchronization:terminal grids now use a server-authoritative per-menu serial repository with full/delta/chunked packets, client-only virtual display slots, local filter/sort/scroll, serial-based item/typed actions, stale-cache resync, and no normal `TerminalScrollPacket` path. Initial repository work is deferred past cold menu construction and ordinary mutations use listener-keyed deltas. SelfTest is 204949; base is 406/406; recipe addon is 17/17; 10k/30k matrix runs pass with cold Storage 27.96/7.64 ms, interaction p95 30.50/159.58 ms, shared index 1,705,552/5,906,888 bytes, and per-menu 130,472/130,457 bytes. GUI visual verification is still required for the deployed artifact. - 2026-08-20 Prism GUI support correction:the combined visual pack now stages the exact `mekanism-generators:a6gl7srE` artifact beside core Mekanism and the audited Flux Networks 8.0.0 artifact, because the Flux Station scenario needs the optional mod registered before its world block can be placed. Deployment/preflight treats all three artifacts as separate managed entries; the pack is 20 jars and visual approval remains user-owned. - 2026-08-19 CI gate repair:NeoForge Energy capability GameTest now matches the intentional Lightning Rod FE representative; Immersive Engineering matrix metadata now uses concrete accepted recipe IDs and optional hammer/electrode descriptors resolve after target item registration. Craftable preparation reuses all stack-independent catalog matches and lazily memoizes Core item sources within a listing. Arc Furnace consumes the reviewed graphite-electrode descriptor resource; Sawmill remains fail-closed because its blade-dependent output modes and secondary products are not represented. Current reviewfix3 10k matrix passed with `craftable_prepare_ms=36.344ms`, shared index `5,894,704` bytes; 30k passed with `32.742ms`, shared index `5,862,608` bytes. The representative IE fixture passes 10/10 and base GameTest passes 406/406. diff --git a/docs/structure.md b/docs/structure.md index b5adafce..fd86487f 100644 --- a/docs/structure.md +++ b/docs/structure.md @@ -11,7 +11,7 @@ | `docs/releasing.md` | Modrinth/CurseForge listing metadata、`publishing` environment、tag發佈、跨平台SHA驗證、retry/rollback與token rotation runbook。 | | `src/api/java/com/swear/autostorage/api/` | 不依賴core implementation的公開addon façade/compat-module contract source set。`main`依賴此output;正式player jar合併它,classified API jar再加入受控root contracts。 | | `src/compat//` | Bundled compatibility modules;每個`java/`只對classified API jar、對應target與必要companion APIs編譯,不可看完整main output,`compat-module.json`單獨擁有entrypoint、required mods、source set、fixture、預期GameTest數、matrix assertion metadata(required mods、accepted/rejected evidence、isolated per-module recipe inventory digest)、reviewed Maven repositories、代表性compile/runtime dependencies,以及Compat Kit module的audited artifact dependency/SHA。Gradle驗證後生成唯一runtime `META-INF/auto_storage/compat-modules.json`、matrix assertion manifest,以及CI/release報告`build/reports/compatibility-modules.md`;matrix run把實際coexistence/unclaimed digest寫入`build/reports/terminal-scale-*.json`,不提交共享expected SHA。新增完整descriptor不需手改共享CI/matrix清單、peer descriptor或全域digest基線。 | -| `src/main/java/com/swear/autostorage/` | Core/runtime Java原始碼;不得直接import任何optional target package。`StorageTerminalMenu`/`Screen`提供共用server-owned grid與layout shell;`CraftingTerminalMenu`/`Screen`只增加Storage、Craftable、Transform、Stations四頁、recipe presentation與output controls。`TerminalLayout`是唯一geometry來源:寬版四頁content bottom一致對齊player inventory上緣,四頁搜尋共用top header位置、focused input router與query parser,裸operator等同空查詢、欄外點擊解除focus,scope只由各頁候選entry決定;Transform左側保留persistent target list並讓source-aware cards填滿其餘高度;Stations依高度計算rows,Processing取得較大且固定左上欄位的三欄flow,Instant使用20px compact icon grid。`TerminalScrollbar`使用14px recessed track及enabled/pressed/disabled vanilla scroller;thumb drag保留grab offset,track按下翻頁並重複,wheel直接跳一個server-aligned row,不保留client動畫狀態。Storage/Craftable使用18列固定menu slot bank,screen依可用高度啟用全部完整列。Stations的第三個utility control切換All/Installed,篩選共用descriptor清單與搜尋結果。client-global偏好由`TerminalClientPreferences`保存,server仍透過103個menu data slots驗證。`CraftableRecipeCatalog`提供server-start/datapack-sync prewarm、`RecipeManager` identity reload invalidation與shared weak candidate index;catalog/Craftable prepare可暫用family typed plan/contract cache與entry lazy RecipeAdapterMatch;stack-independent且已包含typed plan的match在同一次listing直接作variant使用,built-in/legacy item adapters仍執行level/output validation,pending typed plan與stack-dependent variant才重跑adapter resolution。寫入shared Craftable listing後由production `releaseTransientMatches()`釋放所有lazy match/family runtime cache,且不保存recipe-keyed fixed-variant list,因此`shared_index_retained_bytes`量的是compact catalog加shared listing而非classification working set,9 MiB gate可隨compat modules成長而維持。`CraftingTerminalMenu`每Core只保留一份core revision、generated-work threshold及dynamic recipe-state token共同守護的shared Craftable result,Use Player Inventory繞過cache。`StorageCoreBlockEntity`在attach/insert時保留display-name/component keys並增量維護預設Name index,真正cold open不再重建30k名稱;search與其餘sort仍按需建立,GUI fixture才額外顯式預熱。正向Processing work只在跨越Craftable threshold時使shared result重建。`GuiRuntimeFixture`以marker-gated server command枚舉runtime item registry、安裝全部station descriptors並在handoff前準備Craftable,不建立client storage state。`StorageResourceLedger`/`CoreStorageRecord`統一item/fluid/FE/chemical/Mana/addon資源與WORK transaction,`StorageCoreBlockEntity`每tick合併全部station work後只提交一次。`MachineDescriptor`保存每個installable descriptor的localized logical station-family label;`MachineEnergyTable`把label與variant snapshot一起同步,terminal repository wire使payload protocol為1.7。UI資源選擇器顯示Processing與All aggregate(tooltip `Show: All`),Mekanism chemical由registry-backed client renderer顯示exact glyph/amount,`station_work`只留作server技術識別。Transform providers與machine variants都由ordered custom registry擁有;bundled optional bridges只存在於各自`src/compat`與fixture。 | +| `src/main/java/com/swear/autostorage/` | Core/runtime Java原始碼;不得直接import任何optional target package。`StorageTerminalMenu`/`Screen`提供共用server-owned grid與layout shell;`CraftingTerminalMenu`/`Screen`只增加Storage、Craftable、Transform、Stations四頁、recipe presentation與output controls;Craftable diagram由共用 geometry 驅動 native/EMI/JEI 與明確語意驗證的 Flux animation renderer。`TerminalLayout`是唯一geometry來源:寬版四頁content bottom一致對齊player inventory上緣,四頁搜尋共用top header位置、focused input router與query parser,裸operator等同空查詢、欄外點擊解除focus,scope只由各頁候選entry決定;Transform左側保留persistent target list並讓source-aware cards填滿其餘高度;Stations依高度計算rows,Processing取得較大且固定左上欄位的三欄flow,Instant使用20px compact icon grid。`TerminalScrollbar`使用14px recessed track及enabled/pressed/disabled vanilla scroller;thumb drag保留grab offset,track按下翻頁並重複,wheel直接跳一個server-aligned row,不保留client動畫狀態。Storage/Craftable使用18列固定menu slot bank,screen依可用高度啟用全部完整列。Stations的第三個utility control切換All/Installed,篩選共用descriptor清單與搜尋結果。client-global偏好由`TerminalClientPreferences`保存,server仍透過103個menu data slots驗證。`CraftableRecipeCatalog`提供server-start/datapack-sync prewarm、`RecipeManager` identity reload invalidation與shared weak candidate index;catalog/Craftable prepare可暫用family typed plan/contract cache與entry lazy RecipeAdapterMatch;stack-independent且已包含typed plan的match在同一次listing直接作variant使用,built-in/legacy item adapters仍執行level/output validation,pending typed plan與stack-dependent variant才重跑adapter resolution。寫入shared Craftable listing後由production `releaseTransientMatches()`釋放所有lazy match/family runtime cache,且不保存recipe-keyed fixed-variant list,因此`shared_index_retained_bytes`量的是compact catalog加shared listing而非classification working set,9 MiB gate可隨compat modules成長而維持。`CraftingTerminalMenu`每Core只保留一份core revision、generated-work threshold及dynamic recipe-state token共同守護的shared Craftable result,Use Player Inventory繞過cache。`StorageCoreBlockEntity`在attach/insert時保留display-name/component keys並增量維護預設Name index,真正cold open不再重建30k名稱;search與其餘sort仍按需建立,GUI fixture才額外顯式預熱。正向Processing work只在跨越Craftable threshold時使shared result重建。`GuiRuntimeFixture`以marker-gated server command枚舉runtime item registry、安裝全部station descriptors並在handoff前準備Craftable,不建立client storage state。`StorageResourceLedger`/`CoreStorageRecord`統一item/fluid/FE/chemical/Mana/addon資源與WORK transaction,`StorageCoreBlockEntity`每tick合併全部station work後只提交一次。`MachineDescriptor`保存每個installable descriptor的localized logical station-family label;`MachineEnergyTable`把label與variant snapshot一起同步,terminal repository wire使payload protocol為1.7。UI資源選擇器顯示Processing與All aggregate(tooltip `Show: All`),Mekanism chemical由registry-backed client renderer顯示exact glyph/amount,`station_work`只留作server技術識別。Transform providers與machine variants都由ordered custom registry擁有;bundled optional bridges只存在於各自`src/compat`與fixture。 | | `src/apiTest/` | 從不同 Java package、只看classified API jar編譯完整公開contract,包含one-call facade、`MachineCategory`、bounded Core/Bus capability bridge與不把client class連進API bytecode的generic resource renderer,防止addon誤依賴implementation output或package-private internals。 | | `src/compatKitGeneratedFixture/` | Compat Kit v2 generated conformance/resource scaffold的committed compile-only contract;Python由含exact `game_test_namespace`的example plans逐byte重生,每個generated GameTest class都有matching `@GameTestHolder`;Gradle `compileCompatKitGeneratedFixtureJava`只對public API jar與NeoForge/Minecraft編譯,防止generator輸出或SDK surface drift。Provider只提供操作形狀且不作runtime自證,真實語意仍由各integration GameTests驗證。 | | `src/recipeAddonFixture/` | 獨立載入的 NeoForge test mod:註冊兩個custom `RecipeType`、legacy `singleItemToItem`與`deterministicResources` families,並以17個GameTests驗station/discovery、polymorphic fractional work與installed-first preview cycle、exact output、overlapping alternatives/remainders、addon kind capability/terminal/held container、mixed item+mana+fluid commit、generic+native Bus discovery、typed rollback escrow、Creative removal、retained catalyst/tool與capacity rollback。 | diff --git a/scripts/run_prism_gui_session.py b/scripts/run_prism_gui_session.py index d8d4260b..be1c5175 100755 --- a/scripts/run_prism_gui_session.py +++ b/scripts/run_prism_gui_session.py @@ -197,7 +197,8 @@ "Pass the fullscreen gate before pressing hotbar/use/click/scroll.", "The scenario starts aimed at the placed auto_storage:flux_station on its bedrock base; inspect the dedicated Flux Station texture at native size and confirm it is distinct from the Storage Core while retaining the Auto Storage chassis style.", "hotbar `2`, then `u`: open the Crafting Terminal and open Stations. Show: Installed must include Flux Station from the world block even though its item is not installed in the Core.", - "Open the Flux conversion preview and confirm it shows exactly 1 redstone -> 1 flux dust, with the station available from the world block and no world block/entity mutation during the storage transaction.", + "Open the Flux conversion preview and confirm the animated Creating Flux diagram stays inside the same Craftable recipe-card bounds, keeps the shared ledger/navigation/craft controls, and shows exactly 1 redstone -> 1 flux dust.", + "Confirm the animated diagram explains both bedrock and flux_block base options, with the station available from the world block and no world block/entity mutation during the storage transaction.", "Confirm the player inventory remains empty apart from terminal navigation and close with F11 -> bordered window -> Command-Q.", CURRENT_RUN_LOG_CHECK, ], diff --git a/scripts/test_run_prism_gui_session.py b/scripts/test_run_prism_gui_session.py index b76dba7b..a1f8ff98 100644 --- a/scripts/test_run_prism_gui_session.py +++ b/scripts/test_run_prism_gui_session.py @@ -230,6 +230,13 @@ def test_flux_station_scenario_has_visual_and_transaction_checks(self): self.assertIn("1 redstone -> 1 flux dust", checks) self.assertIn("no world block/entity mutation", checks) + def test_flux_station_scenario_checks_the_shared_animated_recipe_card(self): + mod = self.load_script() + checks = "\n".join(mod.SCENARIOS["flux-station"]["checks"]) + self.assertIn("animated Creating Flux", checks) + self.assertIn("same Craftable recipe-card bounds", checks) + self.assertIn("bedrock and flux_block", checks) + def test_patchouli_handoff_uses_current_preloaded_guide_name(self): mod = self.load_script() checks = "\n".join(mod.SCENARIOS["patchouli-guide"]["checks"]) diff --git a/scripts/test_static_regressions.py b/scripts/test_static_regressions.py index bb6e0742..00b1db6f 100644 --- a/scripts/test_static_regressions.py +++ b/scripts/test_static_regressions.py @@ -3253,6 +3253,72 @@ def test_recipe_renderer_boundary_keeps_emi_out_of_base_screen_and_native_path(s self.assertNotIn("import mezz.jei.", native) self.assertNotIn("import mezz.jei.", interface) + def test_flux_animation_requires_explicit_identity_and_semantics(self): + renderer = self.read_required( + "src/main/java/com/swear/autostorage/FluxRecipeDiagramRenderer.java" + ) + screen = self.read_required( + "src/main/java/com/swear/autostorage/CraftingTerminalScreen.java" + ) + interface = self.read_required( + "src/main/java/com/swear/autostorage/RecipeDiagramRenderer.java" + ) + contract = self.read_required( + "src/main/java/com/swear/autostorage/FluxRecipePresentationContract.java" + ) + supports = self.java_block( + renderer, + r"\bpublic\s+boolean\s+supports\s*\(", + "FluxRecipeDiagramRenderer.supports", + ) + self.assertIn("RECIPE_ID.equals(presentation.recipeId())", supports) + self.assertIn("presentation.kind() == RecipePresentationKind.WORLD_STATION", supports) + self.assertIn("matchesExpectedRecipe(presentation)", supports) + self.assertIn("new FluxRecipeDiagramRenderer()", screen) + self.assertIn("fluxRecipeDiagramRenderer.supports", screen) + self.assertIn("usesSharedStationBadge", interface) + self.assertIn("usesSharedStationBadge", screen) + self.assertIn("presentation.shapeless()", contract) + self.assertIn("presentation.stationDescriptorId()", contract) + self.assertIn("ItemStack.isSameItemSameComponents", contract) + self.assertIn("private final ItemStack bedrockStack", renderer) + self.assertIn("private final ItemStack fluxBlockStack", renderer) + + def test_recipe_diagrams_share_vertical_centering_inside_the_diagram_bounds(self): + layout = self.read_required( + "src/main/java/com/swear/autostorage/TerminalLayout.java" + ) + geometry = self.read_required( + "src/main/java/com/swear/autostorage/RecipeDiagramGeometry.java" + ) + emi = self.read_required( + "src/main/java/com/swear/autostorage/compat/EmiRecipeDiagramRenderer.java" + ) + jei = self.read_required( + "src/main/java/com/swear/autostorage/compat/JeiRecipeDiagramRenderer.java" + ) + flux = self.read_required( + "src/main/java/com/swear/autostorage/FluxRecipeDiagramRenderer.java" + ) + + self.assertIn("static int centeredOffset(int containerSize, int contentSize)", geometry) + self.assertIn( + "RecipeDiagramGeometry.centeredOffset(diagram.height(), inputGridSize)", + layout, + ) + self.assertIn( + "RecipeDiagramGeometry.centeredOffset(diagram.height(), scaledHeight)", + emi, + ) + self.assertIn( + "RecipeDiagramGeometry.centeredOffset(diagram.height(), scaledHeight)", + jei, + ) + self.assertIn("RecipeDiagramGeometry.centeredOffset", flux) + self.assertNotIn("RecipeDiagramRenderer.centeredOffset", layout) + self.assertIn("graphics.enableScissor(", flux) + self.assertIn("graphics.disableScissor()", flux) + def test_emi_diagram_adapter_uses_only_public_recipe_widget_contracts(self): renderer = self.read_required( "src/main/java/com/swear/autostorage/compat/EmiRecipeDiagramRenderer.java" diff --git a/src/main/java/com/swear/autostorage/CraftingTerminalScreen.java b/src/main/java/com/swear/autostorage/CraftingTerminalScreen.java index 6ed2b87a..161a68a1 100644 --- a/src/main/java/com/swear/autostorage/CraftingTerminalScreen.java +++ b/src/main/java/com/swear/autostorage/CraftingTerminalScreen.java @@ -25,6 +25,7 @@ public class CraftingTerminalScreen extends StorageTerminalScreen { private final NativeRecipeDiagramRenderer nativeRecipeDiagramRenderer; + private final FluxRecipeDiagramRenderer fluxRecipeDiagramRenderer; private ClientSetup.ViewerBinding preferredViewerBinding; private long preferredViewerGeneration; private RecipeDiagramRenderer preferredRecipeDiagramRenderer; @@ -79,6 +80,7 @@ public class CraftingTerminalScreen extends StorageTerminalScreen inputs = presentation.inputs(); + if (inputs.size() != RecipePresentation.MAX_INPUTS + || !exactItem(inputs.getFirst(), REDSTONE_ID) + || !exactItem(presentation.output(), FLUX_DUST_ID) + || !exactItem(presentation.station(), STATION_ID) + || presentation.stationVariants().size() != 1 + || !exactItem(presentation.stationVariants().getFirst(), STATION_ID)) { + return false; + } + for (int index = 1; index < inputs.size(); index++) { + if (!inputs.get(index).isEmpty()) return false; + } + List resources = presentation.resources(); + return resources.size() == 1 + && resources.getFirst().kind() == RecipePresentation.ResourceKind.ITEM + && resources.getFirst().required() == 1 + && exactItem(resources.getFirst().stack(), REDSTONE_ID); + } + + private static boolean exactItem(ItemStack stack, ResourceLocation id) { + Item expected = BuiltInRegistries.ITEM.get(id); + return expected != Items.AIR + && stack.getCount() == 1 + && ItemStack.isSameItemSameComponents(stack, new ItemStack(expected)); + } +} diff --git a/src/main/java/com/swear/autostorage/RecipeDiagramGeometry.java b/src/main/java/com/swear/autostorage/RecipeDiagramGeometry.java new file mode 100644 index 00000000..1c6d5664 --- /dev/null +++ b/src/main/java/com/swear/autostorage/RecipeDiagramGeometry.java @@ -0,0 +1,10 @@ +package com.swear.autostorage; + +public final class RecipeDiagramGeometry { + private RecipeDiagramGeometry() { + } + + public static int centeredOffset(int containerSize, int contentSize) { + return Math.max(0, (containerSize - contentSize) / 2); + } +} diff --git a/src/main/java/com/swear/autostorage/RecipeDiagramRenderer.java b/src/main/java/com/swear/autostorage/RecipeDiagramRenderer.java index 3f23b56a..9007de68 100644 --- a/src/main/java/com/swear/autostorage/RecipeDiagramRenderer.java +++ b/src/main/java/com/swear/autostorage/RecipeDiagramRenderer.java @@ -8,6 +8,10 @@ public interface RecipeDiagramRenderer { boolean supports(RecipePresentation presentation, Geometry geometry); + default boolean usesSharedStationBadge() { + return true; + } + void render( GuiGraphics graphics, Font font, diff --git a/src/main/java/com/swear/autostorage/RecipePresentation.java b/src/main/java/com/swear/autostorage/RecipePresentation.java index fdcf2ba1..81de09c7 100644 --- a/src/main/java/com/swear/autostorage/RecipePresentation.java +++ b/src/main/java/com/swear/autostorage/RecipePresentation.java @@ -140,6 +140,7 @@ record Metadata( private static final RecipePresentation EMPTY = new RecipePresentation(); private final ResourceLocation recipeId; + private final ResourceLocation stationDescriptorId; private final RecipePresentationKind kind; private final int width; private final int height; @@ -152,6 +153,7 @@ record Metadata( private RecipePresentation() { recipeId = null; + stationDescriptorId = null; kind = RecipePresentationKind.NONE; width = 0; height = 0; @@ -195,6 +197,7 @@ private RecipePresentation() { throw new IllegalArgumentException("Recipe resource rows do not match presentation metadata"); } this.recipeId = metadata.recipeId(); + this.stationDescriptorId = metadata.stationDescriptorId(); this.kind = metadata.kind(); this.width = metadata.width(); this.height = metadata.height(); @@ -220,6 +223,10 @@ public ResourceLocation recipeId() { return recipeId; } + public ResourceLocation stationDescriptorId() { + return stationDescriptorId; + } + public RecipePresentationKind kind() { return kind; } diff --git a/src/main/java/com/swear/autostorage/TerminalLayout.java b/src/main/java/com/swear/autostorage/TerminalLayout.java index e2a76c50..a0eec036 100644 --- a/src/main/java/com/swear/autostorage/TerminalLayout.java +++ b/src/main/java/com/swear/autostorage/TerminalLayout.java @@ -802,7 +802,8 @@ private static RecipeGeometry recipeGeometry(Rect workspace) { int chainWidth = inputGridSize + CONTROL_GAP + CONTROL_SIZE + CONTROL_GAP + outputSize; int chainX = diagram.x() + Math.max(0, (diagram.width() - chainWidth) / 2); - int inputY = diagram.y() + 2; + int inputY = diagram.y() + + RecipeDiagramGeometry.centeredOffset(diagram.height(), inputGridSize); List inputSlots = new ArrayList<>(RecipePresentation.MAX_INPUTS); for (int input = 0; input < RecipePresentation.MAX_INPUTS; input++) { inputSlots.add(new Rect( diff --git a/src/main/java/com/swear/autostorage/compat/EmiRecipeDiagramRenderer.java b/src/main/java/com/swear/autostorage/compat/EmiRecipeDiagramRenderer.java index 4648f5ef..2d927895 100644 --- a/src/main/java/com/swear/autostorage/compat/EmiRecipeDiagramRenderer.java +++ b/src/main/java/com/swear/autostorage/compat/EmiRecipeDiagramRenderer.java @@ -1,5 +1,6 @@ package com.swear.autostorage.compat; +import com.swear.autostorage.RecipeDiagramGeometry; import com.swear.autostorage.RecipeDiagramRenderer; import com.swear.autostorage.RecipePresentation; import com.swear.autostorage.RecipePresentationKind; @@ -252,9 +253,10 @@ private WidgetState widgetState(RecipePresentation presentation, Geometry geomet diagram.width() / (float) cachedWidth, diagram.height() / (float) cachedHeight)); int scaledWidth = Math.round(cachedWidth * scale); + int scaledHeight = Math.round(cachedHeight * scale); return new WidgetState( diagram.x() + (diagram.width() - scaledWidth) / 2, - diagram.y(), + diagram.y() + RecipeDiagramGeometry.centeredOffset(diagram.height(), scaledHeight), scale, cachedWidgets); } diff --git a/src/main/java/com/swear/autostorage/compat/JeiRecipeDiagramRenderer.java b/src/main/java/com/swear/autostorage/compat/JeiRecipeDiagramRenderer.java index 862ec00c..46e15f6d 100644 --- a/src/main/java/com/swear/autostorage/compat/JeiRecipeDiagramRenderer.java +++ b/src/main/java/com/swear/autostorage/compat/JeiRecipeDiagramRenderer.java @@ -1,5 +1,6 @@ package com.swear.autostorage.compat; +import com.swear.autostorage.RecipeDiagramGeometry; import com.swear.autostorage.RecipeDiagramRenderer; import com.swear.autostorage.RecipePresentation; import com.swear.autostorage.RecipePresentationKind; @@ -196,9 +197,11 @@ private LayoutState layoutState(RecipePresentation presentation, Geometry geomet diagram.width() / (float) cachedWidth, diagram.height() / (float) cachedHeight)); int scaledWidth = Math.round(cachedWidth * scale); + int scaledHeight = Math.round(cachedHeight * scale); return new LayoutState( left + diagram.x() + (diagram.width() - scaledWidth) / 2, - top + diagram.y(), + top + diagram.y() + + RecipeDiagramGeometry.centeredOffset(diagram.height(), scaledHeight), scale, layout); } diff --git a/src/main/resources/assets/auto_storage/lang/en_us.json b/src/main/resources/assets/auto_storage/lang/en_us.json index 86d8832d..cb6c76e0 100644 --- a/src/main/resources/assets/auto_storage/lang/en_us.json +++ b/src/main/resources/assets/auto_storage/lang/en_us.json @@ -31,6 +31,9 @@ "gui.auto_storage.page_transform": "Transform", "gui.auto_storage.page_stations": "Stations", "gui.auto_storage.station.flux_station": "Flux Station", + "gui.auto_storage.flux_recipe.title": "Creating Flux", + "gui.auto_storage.flux_recipe.base_options": "Base: %s or %s", + "gui.auto_storage.flux_recipe.unavailable": "Unavailable", "gui.auto_storage.craft_max": "Max", "gui.auto_storage.search_mode.off": "Off", "gui.auto_storage.search_mode.emi": "Viewer", diff --git a/src/main/resources/assets/auto_storage/lang/zh_tw.json b/src/main/resources/assets/auto_storage/lang/zh_tw.json index 02c8e01d..e802bb6e 100644 --- a/src/main/resources/assets/auto_storage/lang/zh_tw.json +++ b/src/main/resources/assets/auto_storage/lang/zh_tw.json @@ -31,6 +31,9 @@ "gui.auto_storage.page_transform": "轉換", "gui.auto_storage.page_stations": "工作站", "gui.auto_storage.station.flux_station": "Flux 工作站", + "gui.auto_storage.flux_recipe.title": "製作 Flux", + "gui.auto_storage.flux_recipe.base_options": "基座:%s 或 %s", + "gui.auto_storage.flux_recipe.unavailable": "無法使用", "gui.auto_storage.craft_max": "最大", "gui.auto_storage.search_mode.off": "關閉", "gui.auto_storage.search_mode.emi": "配方瀏覽器",