Skip to content

Show the crafting machine in crafting option tooltips - #216

Merged
rubensworks merged 3 commits into
master-1.21-ltsfrom
feature/crafting-machine-tooltip
Sep 6, 2026
Merged

Show the crafting machine in crafting option tooltips#216
rubensworks merged 3 commits into
master-1.21-ltsfrom
feature/crafting-machine-tooltip

Conversation

@rubensworks

@rubensworks rubensworks commented Sep 4, 2026

Copy link
Copy Markdown
Member

Closes #181

Hovering a craftable in the storage terminal now says which machine it is crafted in, by name and by icon, below the crafting requirements.

Iron Ingot
Quantity: 1
Crafting Requirements:
[raw iron]
Crafted In: Furnace
[furnace]

When several distinct machines expose the same recipe, the label drops the name and the icons speak for themselves (Crafted In: followed by one icon per machine). Interfaces targeting the same machine type are shown once.

How it works

The machines are resolved server-side in TerminalStorageTabIngredientCraftingHandlerCraftingNetwork, once per channel, from ICraftingNetwork#getRecipeCraftingInterfaces and ICraftingInterface#getTargetMachineItem(). Each interface's machine is resolved at most once per call, since many recipes are commonly exposed by the same interface. They are serialized alongside the recipe and carried to the client on the crafting option, exposed generically through ITerminalCraftingOption#getCraftingMachines() (defaulting to empty, so handlers that cannot determine them are unaffected and write nothing).

To give the machines and the requirements each their own labelled icon grid, tooltips are now built as a List<Either<FormattedText, TooltipComponent>> that mixes text and visual components, rather than a list of lines plus a single trailing component. That changes the last parameter of IIngredientComponentTerminalStorageHandler#drawInstance; the shared slot-grid rendering moved into a ClientCraftingOptionSlotsTooltip base class that both grids extend.

Downstream implementors

IIngredientComponentTerminalStorageHandler is implemented outside this repo by Integrated Mekanism. CyclopsMC/IntegratedMekanism#29 follows this signature and should be merged and released after this PR.

Note that Integrated Mekanism is already broken against Integrated Terminals 1.9.0, independently of this PR: #210 made the TooltipComponent variant of drawInstance the abstract method, which Integrated Mekanism never implemented, so chemicals throw an AbstractMethodError for craftables and crafting job outputs. CyclopsMC/IntegratedMekanism#28 fixes that on its own and can be merged now.

Dependency bumps

ICraftingInterface#getTargetMachineItem() was added in CyclopsMC/IntegratedCrafting#225 and first published in Integrated Crafting 1.6.0-715, which this now pins.

That build requires newer CyclopsCore and CommonCapabilities than were pinned here, so those move to the versions Integrated Crafting itself builds against:

before after
integratedcrafting_version 1.5.0-689 1.6.0-715
cyclopscore_version 1.26.2-808 1.29.3-1096
commoncapabilities_version 2.9.12-263 2.11.5-363

integrateddynamics_version and integratedtunnels_version already matched Integrated Crafting's and are unchanged.

Testing

New game tests in GameTestTerminalCraftingOptionMachines: serialization round-trip (with and without machines), machine resolution from a live network for the regular and the attuned crafting interface against a crafting table and a furnace, and deduplication across two interfaces on the same machine type.

All 47 required tests passed :)

./gradlew build and ./gradlew runGameTestServer both pass against the released Integrated Crafting build, on this branch rebased onto 1a98691.

Verified in a dev client with clientdevbridge-cli, for the regular and the attuned crafting interface against a crafting table and a furnace, plus the multiple-machine case.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RM86uiqD4soLkMyjC9Eeid

rubensworks and others added 2 commits September 6, 2026 13:27
Hovering a craftable in the storage terminal now says which machine it is
crafted in, both by name and by icon, above the crafting requirements.

The machines are resolved server-side once per channel, from the crafting
interfaces that expose each recipe, and travel to the client alongside the
recipe. Interfaces that target the same machine type are only shown once, and
the label names the machine only when there is exactly one of them.

To let the machines and the requirements each get their own labelled icon
grid, tooltips are now built as a list of elements that mixes text and visual
components, rather than a list of lines with a single trailing component.

Closes #181

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RM86uiqD4soLkMyjC9Eeid
@rubensworks
rubensworks force-pushed the feature/crafting-machine-tooltip branch from 95ca62b to 6b80ecf Compare September 6, 2026 13:38
Integrated Crafting 1.6.0-715 is the first released build with
ICraftingInterface#getTargetMachineItem(), which this feature reads.

It requires newer CyclopsCore and CommonCapabilities than were pinned here,
so those move to the versions Integrated Crafting itself builds against.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RM86uiqD4soLkMyjC9Eeid
rubensworks added a commit to CyclopsMC/IntegratedMekanism that referenced this pull request Sep 6, 2026
CyclopsMC/IntegratedTerminals#216 replaces drawInstance's single tooltip
component with a list of elements that mixes text and visual components, so
that a tooltip can label more than one icon grid.

Follow that signature, and bump CommonCapabilities and Integrated Crafting to
the versions that change requires.

Do not merge before Integrated Terminals has released the change, and
integratedterminals_version is bumped to that release.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RM86uiqD4soLkMyjC9Eeid
@rubensworks
rubensworks merged commit d432a04 into master-1.21-lts Sep 6, 2026
3 checks passed
@rubensworks
rubensworks deleted the feature/crafting-machine-tooltip branch September 6, 2026 14:47
rubensworks added a commit to CyclopsMC/IntegratedMekanism that referenced this pull request Sep 6, 2026
…meter

Integrated Terminals 1.9.0-963 is the first released build carrying
CyclopsMC/IntegratedTerminals#216, whose drawInstance signature this follows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RM86uiqD4soLkMyjC9Eeid
rubensworks added a commit to CyclopsMC/IntegratedMekanism that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant