Repository navigation
Unify animated Flux recipe card presentation - #152
Conversation
Swear ReviewMode: Full PR Status: ❌ Failed — review infrastructure/model failure. You can retry with |
There was a problem hiding this comment.
Code Review
This pull request introduces a custom animated recipe presentation for creating Flux in the Crafting Terminal GUI, implementing FluxRecipeDiagramRenderer to render the 1 redstone to 1 flux dust transaction when using a world station. It also unifies vertical centering logic inside the diagram bounds across Native, EMI, JEI, and Flux renderers. The review feedback focuses on optimizing the rendering loop in FluxRecipeDiagramRenderer by caching ItemStack instances (for Bedrock and Flux Block) in the constructor, thereby avoiding per-frame allocations and registry lookups that could cause garbage collection pressure and micro-stuttering.
| public final class FluxRecipeDiagramRenderer implements RecipeDiagramRenderer { | ||
| public static final ResourceLocation RECIPE_ID = ResourceLocation.fromNamespaceAndPath( | ||
| AutoStorage.MODID, "flux_station/redstone_to_flux_dust"); | ||
|
|
||
| private static final ResourceLocation FLUX_BLOCK_ID = ResourceLocation.fromNamespaceAndPath( | ||
| "fluxnetworks", "flux_block"); | ||
| private static final ResourceLocation FLUX_DUST_ID = ResourceLocation.fromNamespaceAndPath( | ||
| "fluxnetworks", "flux_dust"); | ||
| private static final ResourceLocation REDSTONE_ID = ResourceLocation.fromNamespaceAndPath( | ||
| "minecraft", "redstone"); | ||
| private static final ResourceLocation STATION_ID = ResourceLocation.fromNamespaceAndPath( | ||
| AutoStorage.MODID, "flux_station"); | ||
| private static final int CONTENT_WIDTH = 128; | ||
| private static final int CONTENT_HEIGHT = 80; | ||
| private static final int ANIMATION_TICKS = 80; | ||
|
|
There was a problem hiding this comment.
Instantiating ItemStack and performing registry lookups during the render loop (which runs every frame) creates significant garbage collection pressure and micro-stuttering. We should cache the ItemStack instances for Bedrock and the Flux Block in the renderer's constructor to avoid per-frame allocations and lookups.
public final class FluxRecipeDiagramRenderer implements RecipeDiagramRenderer {
public static final ResourceLocation RECIPE_ID = ResourceLocation.fromNamespaceAndPath(
AutoStorage.MODID, "flux_station/redstone_to_flux_dust");
private static final ResourceLocation FLUX_BLOCK_ID = ResourceLocation.fromNamespaceAndPath(
"fluxnetworks", "flux_block");
private static final ResourceLocation FLUX_DUST_ID = ResourceLocation.fromNamespaceAndPath(
"fluxnetworks", "flux_dust");
private static final ResourceLocation REDSTONE_ID = ResourceLocation.fromNamespaceAndPath(
"minecraft", "redstone");
private static final ResourceLocation STATION_ID = ResourceLocation.fromNamespaceAndPath(
AutoStorage.MODID, "flux_station");
private static final int CONTENT_WIDTH = 128;
private static final int CONTENT_HEIGHT = 80;
private static final int ANIMATION_TICKS = 80;
private final ItemStack bedrockStack = new ItemStack(Blocks.BEDROCK);
private final ItemStack fluxBlockStack;
public FluxRecipeDiagramRenderer() {
Block fluxBlock = BuiltInRegistries.BLOCK.get(FLUX_BLOCK_ID);
this.fluxBlockStack = new ItemStack(fluxBlock == Blocks.AIR ? Blocks.BEDROCK : fluxBlock);
}| graphics.renderComponentTooltip(font, List.of(Component.translatable( | ||
| "gui.auto_storage.flux_recipe.base_options", | ||
| new ItemStack(Blocks.BEDROCK).getHoverName(), | ||
| fluxName)), mouseX, mouseY); |
There was a problem hiding this comment.
Reuse the cached bedrockStack to retrieve the hover name instead of allocating a new ItemStack instance.
| graphics.renderComponentTooltip(font, List.of(Component.translatable( | |
| "gui.auto_storage.flux_recipe.base_options", | |
| new ItemStack(Blocks.BEDROCK).getHoverName(), | |
| fluxName)), mouseX, mouseY); | |
| graphics.renderComponentTooltip(font, List.of(Component.translatable( | |
| "gui.auto_storage.flux_recipe.base_options", | |
| bedrockStack.getHoverName(), | |
| fluxName)), mouseX, mouseY); |
| private static ItemStack baseStack(float progress) { | ||
| Block base = progress < 0.5F | ||
| ? Blocks.BEDROCK | ||
| : BuiltInRegistries.BLOCK.get(FLUX_BLOCK_ID); | ||
| return new ItemStack(base == Blocks.AIR ? Blocks.BEDROCK : base); | ||
| } |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e697c12a1c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -1,4 +1,4 @@ | |||
| 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-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。\n\n2026-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. | |||
There was a problem hiding this comment.
Replace the literal newline escape sequences
The inserted \n\n is stored as literal text rather than Markdown line breaks, so the new entry and the existing CurseMaven entry render as one paragraph with visible escape characters. The same mistake on docs/plan.md:1 absorbs the previous plan item into the new list item; replace these sequences with actual newlines.
Useful? React with 👍 / 👎.
| graphics.enableScissor( | ||
| left + diagram.x(), | ||
| top + diagram.y(), | ||
| left + diagram.right(), | ||
| top + diagram.bottom()); |
There was a problem hiding this comment.
Complete the required Flux visual gate
This player-visible renderer and the simultaneous native/EMI/JEI recentering were committed without a completed flux-station Prism handoff—the commit records that the launch was blocked because a warm Prism process was absent. Consequently, clipping, scaled tooltip hitboxes, and the animated base explanation have no required current-run evidence; run python3 scripts/run_prism_gui_session.py --scenario flux-station and complete the user checklist before treating the change as ready.
AGENTS.md reference: AGENTS.md:L183-L183
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Creating FluxCraftable rendererVerification
./gradlew build./gradlew stageAe2CompatAuditAncestryrunDataproduced no changes beyond the intentional language entriesgit diff --checkGUI visual approval remains user-owned; the current
flux-stationhandoff was blocked because the normal warm Prism Launcher was not running.Refs #149